-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Thanks to @johnniwinther for noticing this. Consider the following program:
class A {
void call() {}
}
Function f<X extends A>(X x) => x;
void main() {
print(f(A()));
}This program is rejected by the analyzer as well as the common front end (DartPad based on SDK 3.3.0-213.0.dev). However, the interface of a receiver of type X is the interface of the bound A, which implies that the interface of x does include a method named call, which means that we should be able to tear it off implicitly when the context type is Function or a function type.
The missing support for call is concerned with implicit tear-offs only, the implicit insertion of call that enables an invocation is working in the analyzer as well as the CFE.
Metadata
Metadata
Assignees
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)