Commit 9694d0f2
9694d0f25c04Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 2 files · +1 added · ~1 modified
Description
Merge pull request #251 from mame/pr/sample-shortcut-defers
fix(codegen): name-based sample shortcut defers when recv isn't an array
Details
- Commit
- 9694d0f25c04
- Parent
- 0b3bd1a36903
- Merge parent
- 510d2f6ce314
spinel_codegen.rbmodifiedView file
@@ -2990,6 +2990,13 @@
29902990
if rt == "float_array"29912991
return "float"29922992
end2993+
if rt == "int_array"2994+
return "int"2995+
end2996+
# Not an array — recv has a user-defined `sample`. Defer to2997+
# the user-class dispatch path instead of returning the2998+
# Array#sample default of int.2999+
return ""29933000
end29943001
return "int"29953002
endtest/sample_user_method.rbaddedView file
Loading diff…