You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would have expected Bool? to use the Bool?.class overload, however it uses the parent. Commenting out the parent method reveals the cause:
31| val =StringValue.new("true").get(Bool?)
^--Error: no overload matches 'StringValue#get' with type (Bool|Nil).class
Overloadsare:-StringValue#get(as : Bool | ::Nil.class)-StringValue#get(as : Bool.class)
The restriction is being treated as (Bool | Nil.class) instead of (Bool | Nil).class.
@HertzDevil pointed out on Discord this is a result of using record whereby the type restrictions of the expanded methods is incorrect. I.e. from the {{yield}}.
macrof(x)
{%p x %}
end
f(x : Int32|String.class) # => x : Int32 | String.class
f(y : (Int32|String).class) # => y : Int32 | String.class
The text was updated successfully, but these errors were encountered:
https://play.crystal-lang.org/#/r/c1eo
I would have expected
Bool?
to use theBool?.class
overload, however it uses the parent. Commenting out the parent method reveals the cause:The restriction is being treated as
(Bool | Nil.class)
instead of(Bool | Nil).class
.@HertzDevil pointed out on Discord this is a result of using
record
whereby the type restrictions of the expanded methods is incorrect. I.e. from the{{yield}}
.The text was updated successfully, but these errors were encountered: