-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
front-end-analyzer-unificationIssues where the analyzer and cfe vary (not clearly a bug on one or the other).Issues where the analyzer and cfe vary (not clearly a bug on one or the other).legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
I searched but didn’t find whether a similar issue already exists. Please close this one as a duplicate if it does.
The code below produces an error in the analyzer but works in CFE.
class A<T extends num> {
X foo<X extends T>(X x) => x;
}
class C<T extends num> extends A<num> {
int v;
C(this.v);
X foo<X extends T>(X x) => x + v as X; // Analyzer error. 'C.foo' ('X Function<X extends T>(X)') isn't a valid override of 'A.foo' ('X Function<X extends num>(X)').
}
void main() {
var c = C<int>(1);
print(c.foo(1)); // prints 2
}@eernstg which tool is right here?
Dart SDK version: 3.8.0-38.0.dev (dev) (Sat Jan 25 16:01:44 2025 -0800) on "windows_x64"
Metadata
Metadata
Assignees
Labels
front-end-analyzer-unificationIssues where the analyzer and cfe vary (not clearly a bug on one or the other).Issues where the analyzer and cfe vary (not clearly a bug on one or the other).legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)