Open fgaz opened 1 year ago
This code typechecks but is unsound:
local function cast<A, B>(a: A) : B return a end local n : number = cast("not a number")
https://teal-playground.netlify.app/?c=bG9jYWwgZnVuY3Rpb24gY2FzdDxBLCBCPihhOiBBKSA6IEIKICAgcmV0dXJuIGEKZW5kCgpsb2NhbCBzIDogc3RyaW5nID0gY2FzdCgxKQ%3D%3D
Found in #577
I suspect this is not a coding bug, but a side-effect of the combination of unbound type variables and bivariant types. This may be actually tricky to solve.
This code typechecks but is unsound:
https://teal-playground.netlify.app/?c=bG9jYWwgZnVuY3Rpb24gY2FzdDxBLCBCPihhOiBBKSA6IEIKICAgcmV0dXJuIGEKZW5kCgpsb2NhbCBzIDogc3RyaW5nID0gY2FzdCgxKQ%3D%3D
Found in #577