We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
The following is showing a strong mode error in foo but not foo2.
foo
foo2
void bar(List l) { print(l.length); } /*=T*/ foo/*<T>*/(/*=T*/ arg) { if (arg is List) { bar(arg); } } foo2(arg) { if (arg is List) { bar(arg); } } void main() { foo([1, 2, 3]); }
The error is on the call to bar in foo:
bar
[error] The argument type 'T' cannot be assigned to the parameter type 'List'.
@sigmundch was running into this
The text was updated successfully, but these errors were encountered:
chatted with folks ( @leafpetersen @sigmundch ) but this is by design in the language right now.
Sorry, something went wrong.
Changed 'broken' to 'confusing'.
This is actually not a strong mode specific issue. Type promotion - by design - doesn't kick in because T and List are unrelated.
T
List
This is one of the issues already covered in #25565 - closing in favor of that.
No branches or pull requests
The following is showing a strong mode error in
foo
but notfoo2
.The error is on the call to
bar
infoo
:@sigmundch was running into this
The text was updated successfully, but these errors were encountered: