Commit 7c7a0d1b

7c7a0d1b7db1Merged

ydah <[email protected]> · 6 months ago · 4 files · +2 added · ~2 modified

Description

fix(codegen): use ruby truthiness for scalar conditions

Details

Commit
7c7a0d1b7db1
Parent
1c819212d772

spinel_analyze.rbmodifiedView file

@@ -2585,6 +2585,10 @@
25852585 mname = @nd_name[nid]
25862586 recv = @nd_receiver[nid]
25872587
2588+ if recv < 0 && mname == "block_given?"
2589+ return "bool"
2590+ end
2591+
25882592 # Methods on a `rescue => e` bound exception variable. The variable
25892593 # itself is string-typed but .class / .message / .to_s / .inspect /
25902594 # .full_message return strings; .backtrace returns nil for now.
@@ -3087,7 +3091,7 @@
30873091 return "int"
30883092 end
30893093 if mname == "=~"
3090- return "int"
3094+ return "bool"
30913095 end
30923096 if mname == "<<"
30933097 if recv >= 0