-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Import of anonymous library marked as error #6289
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
Comments
Thanks Fedor. From the spec: "It is a compile-time error if the compilation unit found at the specified URI is not a library declaration." I'll close but let me know if we need to reopen to discuss. Added Area-Editor, AsDesigned labels. |
This comment was originally written by [email protected] From the spec 'A library consists of (a possibly empty) set of imports, and a set of top level declarations.' I have a little problem with our test runner. Currently it imports a file to run unit tests, set our unit Configuration and call main function. Just want to clear things up. So test runner doesn't work without library statement. Of course I can check if there is a library statement and create a library with one part. |
Thanks Fedor. There's a teensy tiny chance Gilad could take another look at this restriction. Thanks for your use case. Hi Gilad, Fedor works on the IntelliJ plugin for Dart. Could you provide context for why an imported library must have a library declaration? Removed Area-Editor label. |
The restriction has been relaxed in the 0.13 draft. The idea is that the library name is inferred if it is not provided. The exact rule for inferring the name is not yet pinned down nor implemented. |
This issue was originally filed by [email protected]
// Foo.dart
import 'Bar.dart'; // error
// Bar.dart
class Bar{}
I don't see any contradiction with specification.
The text was updated successfully, but these errors were encountered: