Closed sethladd closed 9 years ago
Oh, I see that if I hover over the red underline, I see what the Error is. In this case, it's "Could not find main"
Surprised that main is required. My use case is to use try.dartlang.org as a syntax checker.
Good point. We should do something about this.
Issue #19595 has been merged into this issue.
From Issue #19595:
An error is reported in recent development versions, for example, the version live at http://incr.try-dart-lang.appspot.com/ displays an error.
Once https://codereview.chromium.org/285903006/ lands, you'll get a better error message (compilation won't fail and it will be a runtime error). This CL should also enable the warning on Future.
Regardless, I'll keep this bug open to ensure that it is always clear why compilation failed. I'm not sure that a red line is enough.
Set owner to @peter-ahe-google. Removed Type-Defect label. Added Type-Enhancement, Accepted labels.
Luke, perhaps this would be of interest to you. I think it would make sense to collect all (or some) "fatal" errors from the compiler and print them in the console. So for example, without CL 285903006 this would have produced:
Compilation failed due to the following error: Could not find 'main'.
cc @lukechurch.
Issue #19595 has been merged into this issue.
See also issue #19543 (lights/train diagram).
Issue #19595 has been merged into this issue.
The particular problem with "main" has been fixed in dart2js, and I've uploaded a new version of Try Dart!
We're still keeping this open to address the general issue of errors not being obvious.
Consider this code:
class Hero {}
try.dartlang.org on Mar 23rd reports "Compilation failed"
Please see screenshot.
I also added a screenshot of my console.
(Related, would be cool to see the errors reports when compilation fails)
Attachments: [Screen Shot 2014-03-23 at 4.31.52 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-17725/comment-0/Screen Shot 2014-03-23 at 4.31.52 PM.png) (36.01 KB) [Screen Shot 2014-03-23 at 4.33.30 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-17725/comment-0/Screen Shot 2014-03-23 at 4.33.30 PM.png) (32.63 KB)