-
-
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
Module validation failed: Stored value type does not match pointer operand type! #6483
Comments
The code works if you redeclare Minified example: class A(T)
@count : UInt64
def initialize(val)
@count = 0
end
end
class C(T) < A(T)
def initialize(el : Array(T))
super
end
def initialize(el : T)
@count = 1
end
end
class B(T)
@values = [] of C(T)
def initialize(values : Array(T))
@values = values.map { |el| C(T).new(el) }
end
end
bar = B(UInt16).new([1_u16, 2_u16]) This is probably an issue with automatic casting, which doesn't get activated with I'm not sure if this is intended behaviour or not, to not have automatic casting "carry over" with instance vars during inheritance. If this is intended behaviour, the LLVM error message should be caught as a compile error or something. (CC @asterite) |
Thank you for your proposal! When you work in the night almost falling asleep strange things happen. Cut here, paste there, build, WTF? Next day you read yesterdays code and think "What idiot wrote that?". :)
Thanks, that is really great description! |
@serge-name Ah, fair enough. Sorry for the statement at the end, I thought it came off as a bit harsh (which is why I removed it). But seriously though, that code is so obscure I had to comment on it. |
Never mind. Let's make Crystal more stable and shiny :) |
Still being reproduced on
|
Is not reproduced on
|
Hello. When I was playing with a code I received a message:
The code to reproduce:
OS:
Crystal version:
The bug also can be reproduced on master branch with a detailed backtrace:
The text was updated successfully, but these errors were encountered: