-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Null<T> lost in type inference #5517
Comments
The example was taken from |
I don"t even know where to start looking here. I"m assuming it"s not a regression? |
Is that actually unexpected? You call |
Yes, but the problem is that |
Yes, because they unify. It"s clearer if you split up the call: var i:Null<Int> = 1;
var next = new Node(1, null);
new Node(i, next); The only problem here is that the second argument is silently cast from You could maybe make the argument that in the merged call, top-down inference should cause the inner type to be inferred to |
Yeah that what I was expecting here originally. The split-up version is more explicit and should cause an error... |
generated AST (note the inner Node is a
Node<Int>
, notNode<Null<Int>>
):this is problematic for C# target where we have to generate a copy-cast right now
The text was updated successfully, but these errors were encountered: