Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

It is a compile-time error to import two or more libraries that define the same name. #3206

Closed
crelier opened this issue May 24, 2012 · 11 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant
Milestone

Comments

@crelier
Copy link
Contributor

crelier commented May 24, 2012

// Library 1_Imports_A05_t01_p1_lib.dart:

library("duplicate_library_name");

var foo;


// Library 1_Imports_A05_t01_p2_lib.dart:

library("duplicate_library_name");

bar(int x, bool b) { return 0; }


// both libraries define the same library name in their respective headers

import("1_Imports_A05_t01_p1_lib.dart", prefix: "P1");

import("1_Imports_A05_t01_p2_lib.dart", prefix: "P2");

main() {
}


Compile-time error should be reported, but is not.

@crelier
Copy link
Contributor Author

crelier commented May 24, 2012

In case this is not an error, please file a co19 bug for test Language/12_Libraries_and_Scripts/1_Imports_A05_t01 and update the issue number in the co19 status file.

@iposva-google
Copy link
Contributor

The spec says this about the #library tag:

It is a compile-time error if the argument x to a library or resource directive is not a compile-time constant, or if x involves string interpolation.

I see no mention of duplicate library names anywhere in the spec. Gilad, can you please verify?


cc @gbracha.

@gbracha
Copy link
Contributor

gbracha commented May 24, 2012

This is an oversight in the spec. The 0.10 draft will very soon say:

"It is compile-time error to import two different libraries with the same name."

This will allow us to identify libraries by name for reflection and printing, and to experiment with ideas about default prefixes.

I would expect people to use a scalable naming convention a la Java (tm) so that publicly shared libraries have unique names.

@iposva-google
Copy link
Contributor

Set owner to @crelier.

@crelier
Copy link
Contributor Author

crelier commented Sep 6, 2012

Set owner to @turnidge.
Added this to the M1 milestone.
Added Accepted label.

@iposva-google
Copy link
Contributor

Removed this from the M1 milestone.
Added this to the M2 milestone.

@iposva-google
Copy link
Contributor

Removed this from the M2 milestone.
Added this to the M3 milestone.

@iposva-google
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@larsbak
Copy link

larsbak commented May 28, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@iposva-google
Copy link
Contributor

Added AssumedStale label.

@crelier crelier added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant labels Jun 5, 2013
@crelier crelier added this to the M5 milestone Jun 5, 2013
copybara-service bot pushed a commit that referenced this issue Dec 1, 2021
Changes:
```
> git log --format="%C(auto) %h %s" b9edfa5..dcb6aba
 https://dart.googlesource.com/pub.git/+/dcb6abac Merge remote-tracking branch 'origin/cherry-pick2-for-2.15.0'
 https://dart.googlesource.com/pub.git/+/dc857523 Remove duplicated lines in testdata (#3234)
 https://dart.googlesource.com/pub.git/+/acc8ab09 Refactor the test package-server (#3230)
 https://dart.googlesource.com/pub.git/+/1e78c688 Better error messages round 2 (#3223)
 https://dart.googlesource.com/pub.git/+/eaf36513 More links in the repository specification (#3220)
 https://dart.googlesource.com/pub.git/+/c888b018 Remove pedantic and cleanup a few lints (#3224)
 https://dart.googlesource.com/pub.git/+/a4d44c7e Global package server null safety (#3225)
 https://dart.googlesource.com/pub.git/+/ff941887 Merge branch 'cherry-pick-for-2.15.0'
 https://dart.googlesource.com/pub.git/+/efd24e64 Fix hanging event handler for `stdin`. (#3218)
 https://dart.googlesource.com/pub.git/+/d77c14e8 Gitignore validator should not follow symlink dirs (#3209)
 https://dart.googlesource.com/pub.git/+/7c190789 migrate rest of test/ to null-safety (#3207)
 https://dart.googlesource.com/pub.git/+/f24adb64 migrate test/oath2/ test/outdated/ test/token test/validator/ to null-safety (#3206)
 https://dart.googlesource.com/pub.git/+/e7d77a57 migrate test/add, test/cache, test/embedding plus a bit more to null-safety (#3205)
 https://dart.googlesource.com/pub.git/+/a6a73ad2 migrate test/lish/, test/run/, test/upgrade/ and golden_file.dart to null-safety (#3204)
 https://dart.googlesource.com/pub.git/+/b90efc1f Add test that `pub get` works with no $HOME in environment. (#3173)
 https://dart.googlesource.com/pub.git/+/c2fe3966 migrate test/get/ to null-safety (#3203)
 https://dart.googlesource.com/pub.git/+/1d106898 migrate test/hosted/ to null-safety (#3200)
 https://dart.googlesource.com/pub.git/+/afa9932b migrate test/cache and test/downgrade/ to null-safety (#3201)
 https://dart.googlesource.com/pub.git/+/352ca989 migrate test/global/ to null-safety (#3202)
 https://dart.googlesource.com/pub.git/+/64f20ca4 migrate test/descriptor/ and couple more files in test/ to null-safety (#3192)

```

Diff: https://dart.googlesource.com/pub.git/+/b9edfa5e288ea3d1a57d1db054ef844ae7b27d99~..dcb6abac2d7d43258c03b348be42bf4aab9529b1/
Change-Id: I30d33b0b8c3c19097a16543db15c6ae633f0afc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221633
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
copybara-service bot pushed a commit that referenced this issue Oct 4, 2022
…2 revisions)

https://dart.googlesource.com/dartdoc/+log/71545cdf2e5c..9908cf86dd66

2022-10-04 49699333+dependabot[bot]@users.noreply.github.com Bump actions/cache from 3.0.8 to 3.0.10 (#3207)
2022-10-04 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.1.24 to 2.1.26 (#3206)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I6a2ac667e98c93879d05ad2f62239fc438726941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262641
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

5 participants