-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.model-inferenceImplementation of type inferenceImplementation of type inferencetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
This works fine:
class Foo {}
class Bar<T extends Foo?> {
final T foo;
Bar(this.foo);
static Bar<T> bar<T extends Foo>(T foo) {
return Bar(foo); // <-- No need to write Bar<T>(foo)
}
}but if T extends Foo? instead, it doesn't:
class Foo {}
class Bar<T extends Foo?> {
final T foo;
Bar(this.foo);
static Bar<T> bar<T extends Foo?>(T foo) {
return Bar(foo);
// ^^^
// The argument type 'T' can't be assigned to the parameter type 'Never'.
}
}Is this expected behavior?
Metadata
Metadata
Assignees
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.model-inferenceImplementation of type inferenceImplementation of type inferencetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)