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
Improve error message for out-of-order library tags #6082
Comments
I think there's already another bug on file for the analyzer issue. If not, I'll file one. cc @johnniwinther. |
I cannot reproduce this problem. You can help us a great deal if you include a complete example when you report errors. I suspect that you have a "part" (or "#source") directive before line 22. If I modify http://code.google.com/p/dartbox2d/source/browse/example/demos/BallCage.dart to have this sequence of directives: library BallCage; import 'dart:html'; export 'package:box2d/box2d.dart'; part 'demo.dart'; It seems to work fine. However, if I change the order of part and export like this: library BallCage; import 'dart:html'; part 'demo.dart'; export 'package:box2d/box2d.dart'; I get this error: BallCage.dart:22:1: Error: out of order This is to be expected as the specification requires that parts come after imports and exports: libraryDefinition: Set owner to @peter-ahe-google. |
Filed issue #6125 for the analyzer. |
This comment was originally written by domi...@google.com Looks like that's exactly what it was, but the error message I was getting was not suggestive of the problem. |
Changed this bug to be about renaming the error message. Removed Priority-High label. |
Added TriageForM5 label. |
Removed this from the M5 milestone. |
Removed Type-Defect label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
This was probably fixed a while ago. The current error message looks like this: Error: Export declarations should come before parts. Added Fixed label. |
This issue was originally filed by domi...@google.com
just after import 'package:box2d/box2d.dart';
>> The last is failing in dart analyzer:
>> [echo] Analyzing dartbox2d/example/demos/BallCage.dart
>> [exec] file:dartbox2d/lib/box2d_browser.dart:22: Unexpected token
>> 'STRING' (expected '(')
>> [exec] 21:
>> [exec] 22: export 'package:box2d/box2d.dart';
>> [exec] ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> [exec] file:dartbox2d/lib/box2d_browser.dart:22: The token ';' cannot
>> be used as an identifier
>> [exec] 21:
>> [exec] 22: export 'package:box2d/box2d.dart';
>> [exec] ~
>> [exec] Compilation failed with 2 problems.
>>
>> and dart2js:
>> [echo] Generating JS "dartbox2d/example/demos/BallCage.dart.js" from
>> "dartbox2d/example/demos/BallCage.dart"
>> [exec] example/demos/packages/box2d/box2d_browser.dart:22:1: Error:
>> out of order
>> [exec] export 'package:box2d/box2d.dart';
>> [exec] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> [exec] Error: Compilation failed.
sdk version 13679
The text was updated successfully, but these errors were encountered: