Closed
Description
Steps to reproduce
https://github.com/fiurthorn/bug
flutter run -d chrome
Launching lib/main.dart on Chrome in debug mode...
lib/second.dart:3:14: Error: Type 'Entity' can't use itself as a bound.
Try breaking the cycle by removing at least on of the 'extends' clauses in the cycle.
class Second<Entity extends entity.Entity> {
^^^^^^
import 'package:bug/entity.dart' as entity;
class Second<Entity extends entity.Entity> {
Entity entity;
Second(this.entity);
}
Expected results
until 3.13 the import rename work fine, the dart compiler itself, (and the language server) reports no error, but
the dart2js compiler wont resolve the symbols since 3.16.
Actual results
flutter run -d chrome
Launching lib/main.dart on Chrome in debug mode...
lib/second.dart:3:14: Error: Type 'Entity' can't use itself as a bound.
Try breaking the cycle by removing at least on of the 'extends' clauses in the cycle.
class Second<Entity extends entity.Entity> {
^^^^^^
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
fishythefish commentedon Nov 27, 2023
AFAIK, that error comes from the CFE.
sigmundch commentedon Nov 27, 2023
I've confirmed this is a CFE regression. Simple repro that fails also on the VM and fasta:
a.dart:
b.dart:
chloestefantsova commentedon Dec 12, 2023
This issue seems to share the underlying cause with #54097. I'm working on a fix at https://dart-review.googlesource.com/c/sdk/+/337183.
Revert "[cfe] Check type variable dependency cycles via extension types"
[cfe] Check type variable dependency cycles via extension types
[cfe] Reland "Check type variable dependency cycles via extension types"