Skip to content
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

Issues in the section 12.1 of the specification #1774

Closed
DartBot opened this issue Feb 21, 2012 · 12 comments
Closed

Issues in the section 12.1 of the specification #1774

DartBot opened this issue Feb 21, 2012 · 12 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 Feb 21, 2012

This issue was originally filed by ms...@unipro.ru


  1. "Compiling an import directive of the form #import(s) is equivalent to compiling the directive #import(s, prefix: “”);."
    At the same time the spec states that "It is a compile-time error if the value of s2 [prefix] is not a valid identifier."

So the directive #import(s, prefix: “”) is wrong since "" is not a valid identifier.

  1. "It is a compile-time error to import two or more libraries that define the same name."
    It is not clear what is the "name" "defined" by a library.
    Conflicting top-level names are prohibited earlier in this chapter, so in this case this rule looks like a duplicate of the previous rule:

"It is a compile-time error if a name N is introduced into the library scope of a library A, and either: ... "

  1. The spec does not describe a multiple import of a library with different prefixes. Does this produce any errors/warnings? Can names be accessed by any prefix or only by the last one?
    This question is inspired by the issue Importing core library with a prefix does not remove the names from the global namespace #939.
  2. In this section it's not explicitly stated that it is a compile-time error if an imported library does not have a library directive. There is the library production in the section 12:
    libraryDefinition:
      scriptTag? libraryName import* include* resource* topLevelDefinition*

;
So the program composed according to this production could be imported fine since it must contain a libraryName.
But the script definition in section 12.3 contains only optional libraryName and it is not clear is it fine or not to import the script without libraryName.
The only hint is given as a non-normative text: "Named scripts are composable: they can be used as libraries by other scripts and libraries."

@sethladd
Copy link
Contributor

Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Feb 28, 2012

Set owner to @gbracha.
Added Accepted label.

@DartBot
Copy link
Author

DartBot commented Mar 13, 2012

This comment was originally written by rodion...@unipro.ru


I assume it means library name.
In that case, there isn't a compile-time error, when you import two different library files, with different prefixes, that declare the same library name in their headers.

@DartBot
Copy link
Author

DartBot commented Mar 13, 2012

This comment was originally written by rodion...@unipro.ru


the above comment was about point 2, which is unchanged in 0.08 draft

@anders-sandholm
Copy link
Contributor

Added this to the M1 milestone.

@gbracha
Copy link
Contributor

gbracha commented May 8, 2012

The 0.9 draft addresses these points.

  1. The empty string is now explicitly allowed.
  2. The duplication has been eliminated.
  3. Due to the introduction of a separate import scope, the issue is clear.
  1. We now require a library.
    Added Done label.

@DartBot
Copy link
Author

DartBot commented May 18, 2012

This comment was originally written by rodion...@unipro.ru


there's still ambiguity in the spec:
Any name N de ned by I is in scope in L, unless either:
-� a declaration with the name N exists in L. OR
�- a pre x combinator with initial argument N is used in L.

Seems to imply that it's ok to have name conflicts between imported namespace and script's own namespace and in case of identical names one just shadows the other.
Doesn't explicitly say anywhere it's a compile-time error, yet it is in the latest VM.

@gbracha
Copy link
Contributor

gbracha commented May 18, 2012

There is no ambiguity in the spec. It odes not seem to imply that imports may conflict with the library and the library takes precedence - it just says so. The implementation is behind and teher is a bug filed against it.

@DartBot
Copy link
Author

DartBot commented May 21, 2012

This comment was originally written by rodion...@unipro.ru


Got it.

Another question regarding point 2 now:
the wording was changed but I don't think it's become any clearer
"It is a compile-time error to import two or more namespaces that de fine
the same name." - could you please explain what exactly does this mean if it's not a duplicate of the earlier assertion? :)

@DartBot
Copy link
Author

DartBot commented May 21, 2012

This comment was originally written by rodion...@unipro.ru


Also, the requirement that URI must be a compile-time constant and not involve string interpolation have been removed. Please clarify the situation.
Latest VM build seems to require a string constant but, like you said, it is not necessarily a reliable witness.

@DartBot
Copy link
Author

DartBot commented May 21, 2012

This comment was originally written by rodion...@unipro.ru


Is the following a typo?
"It is a compile-time error if any of the elements of the fi rst argument of a use of a show combinator is not a valid identifi er."

last assertion of the subchapter 12.2

@DartBot
Copy link
Author

DartBot commented Jun 19, 2012

This comment was originally written by rodion...@unipro.ru


Regarding spec v0.10

Is one of these statements in 12.2 redundant or am I reading it wrong?

"It is a compile-time error if a name N is introduced into the import names-
pace of a library A, and another import also introduces N into the import
namespace of A."

"It is a compile-time error to import into a library two or more namespaces
that de fine the same name."

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jun 19, 2012
@DartBot DartBot added this to the M1 milestone Jun 19, 2012
copybara-service bot pushed a commit that referenced this issue Oct 19, 2022
…_stack_trace, source_maps, see, stack_trace, test, webdev

bazel_worker (https://github.com/dart-lang/bazel_worker/compare/9710de6..75a947f):
  75a947f  2022-10-18  Nate Bosch  Prepare to publish (#63)

collection (https://github.com/dart-lang/collection/compare/ca45fc4..efd709f):
  efd709f  2022-10-18  Kevin Moore  Fix doc comment references among other new lints (#253)

markdown (https://github.com/dart-lang/markdown/compare/d72ae07..93d0eee):
  93d0eee  2022-10-14  Kevin Moore  Misc package cleanup, mostly lints (#468)
  16781b6  2022-10-14  Kevin Moore  CI: update actions, add dependabot (#469)

pub_semver (https://github.com/dart-lang/pub_semver/compare/7671359..28159b8):
  28159b8  2022-10-14  Devon Carew  prep for publishing (#73)

source_map_stack_trace (https://github.com/dart-lang/source_map_stack_trace/compare/72dbf21..8d8078f):
  8d8078f  2022-10-18  Devon Carew  update ci; prep for publishing (#30)

source_maps (https://github.com/dart-lang/source_maps/compare/e93565b..c7e8963):
  c7e8963  2022-10-18  Devon Carew  adjust the min sdk we test against (#68)
  4f0b1e2  2022-10-18  Devon Carew  update ci; prep for publishing (#67)

sse (https://github.com/dart-lang/sse/compare/00084c4..283568d):
  283568d  2022-10-14  Devon Carew  update ci; prep for publishing (#64)

stack_trace (https://github.com/dart-lang/stack_trace/compare/9697e4c..dce0013):
  dce0013  2022-10-18  Kevin Moore  fix changelog link

test (https://github.com/dart-lang/test/compare/58beb14..f704d5a):
  f704d5af  2022-10-17  godofredoc  Add scorecard badge to test repo. (#1774)

webdev (https://github.com/dart-lang/webdev/compare/69aac60..5343edb):
  5343edb  2022-10-17  Elliott Brooks (she/her)  Migrate more files to null-safety (#1758)
  ce498c2  2022-10-14  Elliott Brooks (she/her)  Migrate `configuration.dart` and `shared.dart` to null-safety  (#1757)

Change-Id: I8859b1abc22f630c2136a69b0ad5a836691b9dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264881
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
copybara-service bot pushed a commit that referenced this issue Nov 3, 2022
…t, test_process, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

browser_launcher (https://github.com/dart-lang/browser_launcher/compare/981ca88..5fa0bd6):
  5fa0bd6  2022-11-01  Kevin Moore  Update lints, require Dart 2.17, add dependabot (#34)

dartdoc (https://github.com/dart-lang/dartdoc/compare/3273437..179ada0):
  179ada02  2022-11-02  Sam Rawlins  Change _HashableChildLibraryElementVisitor to be a RecursiveElementVisitor (#3242)
  a6e7d908  2022-11-02  Sam Rawlins  Make Inheritable.isOverride late final non-nullable (#3235)
  c4f52cf9  2022-11-02  Sam Rawlins  Test records support in typedefs (#3239)
  f74e129f  2022-11-02  Sam Rawlins  Make Accessor.documentationComment late final non-nullable (#3240)
  ad50bfbc  2022-10-31  dependabot[bot]  Bump github/codeql-action from 2.1.28 to 2.1.29 (#3238)

http (https://github.com/dart-lang/http/compare/738a55b..6339026):
  6339026  2022-11-02  Brian Quinlan  Make timeout and cache controllable per-request. (#815)
  51dbca2  2022-10-31  Brian Quinlan  Add a streaming request example. (#813)

mime (https://github.com/dart-lang/mime/compare/bf041aa..d80f4d0):
  d80f4d0  2022-11-02  Liu YuanYuan  Add .avif to extension map (#70)
  3a6b14e  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#72)

string_scanner (https://github.com/dart-lang/string_scanner/compare/10435a4..4a5cbc5):
  4a5cbc5  2022-10-31  Kevin Moore  Make code in readme consistent with example (#49)

test (https://github.com/dart-lang/test/compare/b82fc0b..173a36f):
  173a36f2  2022-11-01  Jacob MacDonald  prep packages to publish (#1780)
  fd8e2b68  2022-10-31  Devon Carew  fix an issue with the github reporter (#1779)

test_process (https://github.com/dart-lang/test_process/compare/068f9f8..1774aa7):
  1774aa7  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#36)

webdev (https://github.com/dart-lang/webdev/compare/c350055..069b870):
  069b870  2022-11-01  Elliott Brooks (she/her)  Prepare webdev for release to v.2.7.12 (#1775)
  cb06447  2022-11-01  Elliott Brooks (she/her)  Prep DWDS for release (#1774)
  daa154d  2022-11-01  Elliott Brooks (she/her)  Reset MV3 extension to nice starting point (#1773)
  98a6142  2022-11-01  Jakub Vrána  Remove // ignore: unsafe_html. (#1759)
  939e285  2022-10-31  Elliott Brooks (she/her)  Update documentation for Webdev release process (#1771)
  0428ffb  2022-10-31  Elliott Brooks (she/her)  Update package:file to latest version (#1770)

Change-Id: I5020d718f6c009bca4f9b5e69232dc425b9d3409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267761
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
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

5 participants