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
{{ message }}
Repository navigation
A record literal with a run-time field cannot be assigned to a class type (invalid cast) #487
error: invalid cast from {x:s32, items:s32[]} to P
Expected: 2.
With every field constant ({ x: 1, items: [1, 2] }), the record is a constant tuple and the cast works (castTupleLikeVariants: constant tuple to class goes through castTupleToClass). A record with a run-time field is a ts.CreateTuple/slot value of tuple type, and the tuple-to-class branch reports "invalid cast" instead of building the instance the same way.
Activity
An object literal with methods assigned to a class is an error (#494)
An object literal with methods assigned to a class is an error (#494) (…
own: a record literal assigned to a class type is the instance (#492) (…