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
classTest[A, A]: { x: A }
//│ Defined class Test
t =Test { x =42 }
//│ t: Test['A | 'A0 .. 42 & 'A | 'A & 'A0, 'A | 'A0 .. 42 & 'A | 'A & 'A0] with {x: 42}
t :Test[bool, int]
//│ res: Test[bool | int .. nothing, bool | int .. nothing]
t :Test[int, bool]
//│ ╔══[ERROR] Type mismatch in type ascription://│ ║ l.10: t : Test[int, bool]//│ ║ ^//│ ╟── expression of type `42` does not match type `bool`//│ ║ l.4: t = Test { x = 42 }//│ ║ ^^//│ ╟── but it flows into reference with expected type `Test[int, bool]`//│ ║ l.10: t : Test[int, bool]//│ ║ ^//│ ╟── Note: constraint arises from type reference://│ ║ l.10: t : Test[int, bool]//│ ║ ^^^^//│ ╟── from record type://│ ║ l.1: class Test[A, A]: { x: A }//│ ╙── ^^^^^^^^//│ res: Test[bool | int .. nothing, bool | int .. nothing]
Currently the last one takes precedence, and the output contains duplicate type variables. (It breaks surprisingly few things besides ascription.)
The text was updated successfully, but these errors were encountered:
Currently the last one takes precedence, and the output contains duplicate type variables. (It breaks surprisingly few things besides ascription.)
The text was updated successfully, but these errors were encountered: