-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ICE with untyped Array as instance var initializer #5383
Comments
@xfbs, Where do |
Oh, my bad. I guess I simplified the code too much before posting. So the original code that triggers the bug was something like this: class Paths
def initialize(x, y)
max_x = 0
max_y = 0
@count = Array.new(max_x){Array.new(max_y)}
end
end So, both Array(Array(Int32)).new(max_x){Array(Int32).new(max_y)} I'm wildly guessing here that the compiler doesn't like the fact that I've omitted the type specifiers, and that triggered some kind of internal bug? |
Minimal: Array.new(0) { Array.new(0) } Fixed: Array.new(0) { Array(Int32).new(0) } |
Can anyone confirm if this is fixed by #4974? (and by extension 0.24.1) I'm 98% sure it's a dupe. |
same same but different. crashes in master |
Works for me on master:
Did you make sure to |
@RX14 try this, which is original/similar code by op:
|
also for this, which is op code:
failure on both |
Thanks. Seems using any type of generic parameter inference is broken but only at the class level. |
I don't really know how to search if this bug has been posted before because I'm not sure what to search for, the error I'm getting is rather cryptic. This is the error I'm getting:
This is the minimal file to trigger the bug:
And this is the version of the compiler I'm using:
I'm running crystal on an OS X 10.11 El Capitan, and I installed crystal with homebrew if that makes any difference. Btw kudos to the team, I've really enjoyed playing with the language in the past few days!
The text was updated successfully, but these errors were encountered: