-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Type error in function invocation (generic type is inferred to Null instead of actual type) #43253
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
Comments
The problem is Your function has a type of |
Thanks for clarifying. Though I would still say that it is highly unintuitive and seems like it is leaking implementation details of the VM into the userspace code. It is very confusing when the code compiles and says "yup, this will be |
Turns out it does complain if you specify type arguments explicitly... It's just that Thanks for the help! |
Agreed, this is a tricky error to spot (even for very experienced Dart developers, see google/quiver-dart@41b4f69 for instance).
This is not the VM, it's the Dart compiler behaving like specified. You'll get the same result with dart2js and ddc.
Time to 👍 dart-lang/language#213 then :) |
Expected output
Actual output
Repro code
The text was updated successfully, but these errors were encountered: