Open
Description
It looks like the lint considers Foo<dynamic>
and Foo<Object>
to be the same, so it doesn't allow a left hand side type to 'cast' between the two:
class A<T> {
T _value;
A(this._value);
T get value => _value;
}
class Foo {
String foo;
Foo(this.foo);
}
A<Object> b() {
return A<Foo>(Foo('hello world'));
}
void main() async {
// This gives #omit_local_variable_types
// final A a = b();
// This gives The getter 'foo' isn't defined for the class 'Object'.
final a = b();
final s = a.value.foo;
print(s);
}
Metadata
Metadata
Assignees
Labels
A bug or feature request we're likely to work onFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.Issues with the analyzer's support for the linter packageIssues related to lint rules that report a problem when it isn't a problem.Incorrect behavior (everything from a crash to more subtle misbehavior)