Skip to content

CFE spuriously reports some non-recursive representation types as self-dependency #54169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chloestefantsova opened this issue Nov 28, 2023 · 0 comments
Assignees
Labels
cfe-feature-extension-types Implement extension types feature in the CFE legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@chloestefantsova
Copy link
Contributor

Consider the following program.

extension type E1<X>(X it) {}
typedef F<X> = X;
extension type E2<X>(E1<F<E1<X>>> it) {}

The CFE emits the following compile-time error, even though the type doesn't depend on itself.

/tmp/maybe.dart:3:22: Error: An extension type can't depend on itself through its representation type.
extension type E2<X>(E1<F<E1<X>>> it) {}
                     ^
/tmp/maybe.dart:1:16: Context: The issue arises via this extension type declaration.
extension type E1<X>(X it) {}
               ^^
/tmp/maybe.dart:2:9: Context: The issue arises via this type alias.
typedef F<X> = X;
        ^
@chloestefantsova chloestefantsova added legacy-area-front-end Legacy: Use area-dart-model instead. cfe-feature-extension-types Implement extension types feature in the CFE labels Nov 28, 2023
@chloestefantsova chloestefantsova self-assigned this Nov 28, 2023
@lrhn lrhn added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfe-feature-extension-types Implement extension types feature in the CFE legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants