Skip to content

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

Closed
DartBot opened this issue Oct 26, 2012 · 6 comments
Closed

Import of anonymous library marked as error #6289

DartBot opened this issue Oct 26, 2012 · 6 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Milestone

Comments

@DartBot
Copy link

DartBot commented Oct 26, 2012

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.

@sethladd
Copy link
Contributor

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.

@DartBot
Copy link
Author

DartBot commented Oct 27, 2012

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.

@sethladd
Copy link
Contributor

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.
Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Nov 7, 2012

We are looking at this issue. Generally, we need a stable way to refer to a library, and the library name solve sthat problem.


Set owner to @gbracha.
Added this to the M2 milestone.
Added Accepted label.

@gbracha
Copy link
Contributor

gbracha commented Nov 26, 2012

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.

@gbracha
Copy link
Contributor

gbracha commented Nov 28, 2012

I've submitted issue #7012 for the name inference issue. This bug is now closed.


Added Done label.

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Nov 28, 2012
@DartBot DartBot added this to the M2 milestone Nov 28, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

4 participants