-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[compiler] (inline classes/pattern)-related crash. #52667
Comments
This crash would be caused by missing parts of the implementation of inline classes (the implementation isn't yet complete). The crash occurred when the example program was running in dart-pad, but it seems to be associated with the common front end. @johnniwinther, do you agree that this might well be a CFE issue? abstract class Foo {}
inline class FooBar implements Foo { // (1)
final int i;
const FooBar(this.i);
}
inline class FooBaz implements Foo { // (2)
final int i;
const FooBaz(this.i);
}
void main() {
final a = FooBar(0);
switch (a) {
case FooBar(i: final a):
print("FooBar $a");
}
} (1) and (2) should be reported as compile-time errors. There is ongoing discussion about an extension to the inline class feature which will allow an inline class to have a non-inline class in its An inline class used in an object pattern (like It actually crashes, in a very similar way as the program with |
This is a CFE issue. The implementation of inline classes cannot rely on the existing implementation for regular classes so we need to rework all such parts, including the handling in patterns. |
Thx! |
The compiler crashes with the following message when compiling the following code:
Reproducible on DartPad:
The text was updated successfully, but these errors were encountered: