New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codegen bug: Call parameter type does not match function signature #13209
Comments
The code is obviously nonsense, it's the result of stripping down a quite big chunk of code. |
This is actually a codegen error, unrelated to any macros. def a(value : String)
raise("runtime_assert") if !(value.is_a?(Int))
value = [1,value].max
end
a("42") Full stack trace with LLVM 15 (Crystal version 1.8.0-dev [3a360b1]):
The code works fine in the interpreter, btw. ;) |
Thanks for your quick reply! What about the "BUG: trying to downcast..." - is that related as well? And what about this macro parenthesis issue - is that really intended? macro m(x)
puts(3 * {{x}})
{% debug %}
end
m(2+1) # expecting 9
# -> puts(3 * 2 + 1)
# -> 7 |
Probably yes.
Yes. But perhaps this can be improved, see #6254 |
wrt. macro arguments & parenthesis: as an intermediate step probably some explicit hint in the docs would help a bit. |
I'm using Crystal 1.7.3 on Ubuntu 18.04.
The text was updated successfully, but these errors were encountered: