-
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
DartPad crashes when redirecting a non const constructor to a const one. #34506
Comments
Thanks for reporting! I noted that there is no error for a redirecting generative constructor when it is constant and redirects to a non-constant constructor, and that's clearly a bug. Created #34509 for that. But your example shows more, namely that
This is very likely to mean that the problem in dartpad will go away when a sufficiently recent version of I don't know the schedule for getting these updates into dartpad so I'll let others comment on that, but I guess this issue could be re-purposed to basically request such an update, or it could be closed because the update will happen anyway. Edit: @devoncarew, can you say something about the schedule? |
All the The front-end should be catching this before it reaches dart2js. |
|
cc @jcollins-g |
FYI: Currently, dartpad tracks the stable branch of Dart, so when a stable release includes this change DartPad should pick it up quickly. |
dartpad, running now on Dart 2.5.0, does not crash in dart2js, but correctly reports static errors from dartanalyzer, and dart2js reports correct compile errors. |
DartPad crashes when redirecting a non const constructor to a const one. (see attached code)
I have to admit the parser recognized the error and showed some red signs. I went ahead anyway and thus managed to crash the compiler.
The code:
Note that the example runs fine when instead of the Foo.arg() constructor Foo.one() or Foo() is used.
Error compiling to JavaScript:
main.dart:12:9:
Internal Error: The compiler crashed when compiling this element.
const Foo.arg(int a) : this._impl(_Impl.arg(a));
^
The compiler is broken.
When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.
The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.
Please include the following information:
the name and version of your operating system,
the Dart SDK build number (2.0.0), and
the entire message you see here (including the full stack trace
below as well as the source location above).
The text was updated successfully, but these errors were encountered: