-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dartc: conflict of a library prefix and a name in the importing library should produce a compile error #3340
Comments
Added Area-Analyzer, Triaged labels. |
Added this to the M1 milestone. |
https://chromiumcodereview.appspot.com/10538077 Added Started label. |
https://code.google.com/p/dart/source/detail?r=8500 Added Fixed label. |
This comment was originally written by [email protected] By the way, what about conflicts between prefix and a name imported from a second library? Spec doesn't seem to elaborate on that. |
I would assume that prefixes are added to the library scope like any other name and that a conflict with another imported name would be a compile time error. |
Changes: ``` > git log --format="%C(auto) %h %s" 8f5ab7b..94ae66a https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212) https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346) https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361) https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305) https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358) https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215) https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356) https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357) https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359) https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354) https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352) https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349) https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347) https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341) https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340) https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335) https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332) https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331) https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330) https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313) https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320) https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311) https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304) https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297) https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295) https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757) ``` Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..94ae66a660cc187cc46ceaf1ab96bdcf8d48a313/ Change-Id: I121fa281ad77991ef10938a3c228ce1d62e748db Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238901 Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
This reverts commit 6e00bb1. Reason for revert: https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/flutter-engine-linux/16089/overview Original change's description: > Bump pub to 94ae66a660cc187cc46ceaf1ab96bdcf8d48a313 > > Changes: > ``` > > git log --format="%C(auto) %h %s" 8f5ab7b..94ae66a > https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212) > https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346) > https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361) > https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305) > https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358) > https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215) > https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356) > https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357) > https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359) > https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354) > https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352) > https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349) > https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347) > https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341) > https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340) > https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335) > https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332) > https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331) > https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330) > https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313) > https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320) > https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311) > https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304) > https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297) > https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295) > https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757) > > ``` > > Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..94ae66a660cc187cc46ceaf1ab96bdcf8d48a313/ > Change-Id: I121fa281ad77991ef10938a3c228ce1d62e748db > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238901 > Reviewed-by: Jonas Jensen <[email protected]> > Commit-Queue: Sigurd Meldgaard <[email protected]> [email protected],[email protected] Change-Id: I2402e8647ad79a613d8be55a85a7f05f511a4081 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239301 Reviewed-by: Sigurd Meldgaard <[email protected]> Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
Changes: ``` > git log --format="%C(auto) %h %s" 8f5ab7b..a3a102a https://dart.googlesource.com/pub.git/+/a3a102a5 Fix equality and hashcode for the sdk descriptors (#3367) https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212) https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346) https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361) https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305) https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358) https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215) https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356) https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357) https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359) https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354) https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352) https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349) https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347) https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341) https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340) https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335) https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332) https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331) https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330) https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313) https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320) https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311) https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304) https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297) https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295) https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757) ``` Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..a3a102a549388a6dbfecc9252fabb618f9a2f5f7/ Change-Id: I8d0ea375039ea450d397871d9fac35d590ea8869 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239315 Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
…ath, pool, source_maps, test, tools, webdev Revisions updated by `dart tools/rev_sdk_deps.dart`. args (https://github.com/dart-lang/args/compare/b08471e..9305d5a): 9305d5a 2023-02-15 Naoto Kaneko Update README.md (#236) characters (https://github.com/dart-lang/characters/compare/29f3a3e..3281cc7): 3281cc7 2023-02-16 Devon Carew blast_repo fixes (#75) dartdoc (https://github.com/dart-lang/dartdoc/compare/3931595..dba6f94): dba6f946 2023-02-16 Janice Collins Preserve type aliases for records in output (#3340) 96e61903 2023-02-16 Sam Rawlins Remove unused additionalOptions parameter, other little refactorings (#3339) f64290e1 2023-02-13 Devon Carew remove an unused css attribute (#3335) c055526a 2023-02-13 Devon Carew fix an issue where we created a temporary directory when performing a dry run (#3334) 1f6c8db5 2023-02-13 dependabot[bot] Bump github/codeql-action from 2.2.1 to 2.2.4 (#3337) f1fa0efc 2023-02-13 dependabot[bot] Bump actions/cache from 3.2.4 to 3.2.5 (#3338) ffi (https://github.com/dart-lang/ffi/compare/69d7596..32f5eef): 32f5eef 2023-02-20 Daco Harkes Bump SDK constraint to 4.0.0 (#185) http (https://github.com/dart-lang/http/compare/f4b365e..c13a3f8): c13a3f8 2023-02-17 Alex Li ✨ Add Cronet embedded tool (#853) markdown (https://github.com/dart-lang/markdown/compare/f51c24c..4befe66): 4befe66 2023-02-16 Zhiguang Chen Do not generate heading IDs for headings with no content in `HeaderWithIdSyntax` (#522) cae08af 2023-02-15 Kevin Moore Prepare to release v7.0.1 (#520) bdbaf76 2023-02-15 Zhiguang Chen Remove lookarounds from autolink extension patterns (#519) eb09fac 2023-02-14 Kevin Moore Move to pkg:dart_flutter_team_lints (#518) 51a6389 2023-02-15 Zhiguang Chen Add line endings to HTML blocks (#512) a4cd7a0 2023-02-14 Kevin Moore Label tests that only run on the VM: allows running tests with browser (#516) 6788042 2023-02-14 Kevin Moore CI: add publish and response workflows (#517) mockito (https://github.com/dart-lang/mockito/compare/d2a8df1..ed5bd84): ed5bd84 2023-01-09 Ross Wang Relax mixin criteria 781752c 2023-02-13 Sam Rawlins Change `void` to `dynamic` when overriding method arguments 71e41b9 2023-02-10 Sam Rawlins Add `ignore_for_file: use_of_void_result` d5a25f8 2023-02-08 Sam Rawlins Fix violations of `unnecessary_parenthesis` lint path (https://github.com/dart-lang/path/compare/a95f1e9..24b58a2): 24b58a2 2023-02-20 Kevin Moore Move to team lints, require Dart 2.19 (#138) 8ec8ca0 2023-02-18 Kevin Moore blast_repo fixes (#137) pool (https://github.com/dart-lang/pool/compare/51f1131..694cfd8): 694cfd8 2023-02-20 Kevin Moore move to package:dart_flutter_team_lints, require Dart 2.19 (#65) 40bf2af 2023-02-20 Kevin Moore blast_repo fixes (#64) source_maps (https://github.com/dart-lang/source_maps/compare/cf44db3..a112e98): a112e98 2023-02-16 Devon Carew configure publishing automation (#74) test (https://github.com/dart-lang/test/compare/b5e70db..e56c643): e56c6439 2023-02-17 Jacob MacDonald Add exe compiler, supports running tests compiled to native executables (#1941) f80dfa00 2023-02-16 Nate Bosch Add note about why we are replacing matcher (#1940) 732ae1de 2023-02-15 Nate Bosch Add `because` usage in examples (#1939) f6df9756 2023-02-15 Jacob MacDonald Fix typo in readme (#1937) aca53419 2023-02-14 Nate Bosch Add a caret constraint for matcher (#1927) f7f3a019 2023-02-14 Jacob MacDonald use test_api/backend.dart instead of test_core/backend.dart (#1936) de40c1c0 2023-02-14 Jacob MacDonald Add support for `--compiler` flag (#1903) 1f42db8c 2023-02-13 Devon Carew updates to package:checks docs (#1933) tools (https://github.com/dart-lang/tools/compare/48a544b..a53933c): a53933c 2023-02-17 Elias Yishak [package:dash_analytics] Tests for conforming to GA4 Measurement Protocol limitations (#9) c54430b 2023-02-17 Devon Carew add some clarification to the top-level readme (#8) webdev (https://github.com/dart-lang/webdev/compare/0bae2be..ae7eb80): ae7eb80 2023-02-17 Anna Gringauze Add tests for object inspection (#1973) 7d80a2c 2023-02-17 Elliott Brooks (she/her) Ignore offset / count if an instance has no `length` (#1972) cd66172 2023-02-17 Elliott Brooks (she/her) [MV3 Debug Extension] User can reload app and continue to debug (#1968) 8b7f9d3 2023-02-16 Anna Gringauze Re-enable weak webdev tests (#1960) 83d8e47 2023-02-16 Elliott Brooks (she/her) [MV3 Debug Extension] Variables in panel.dart should be private (#1969) 4e85e74 2023-02-16 Elliott Brooks (she/her) [MV3 Debug Extension] The new debug extension can be run on Manifest V3 or Manifest V2 (#1966) 3982f5f 2023-02-15 Elliott Brooks (she/her) [MV3 Debug Extension] Clean up tests in preparation for supporting compiling to MV2 (#1964) 3ad544e 2023-02-15 Elliott Brooks (she/her) [MV3 Debug Extension] Remove isMV3Extension field from DevtoolsRequest (#1963) c77043e 2023-02-14 Elliott Brooks (she/her) [MV3 Debug Extension] Fix isDevMode getter (#1962) a761125 2023-02-14 Elliott Brooks (she/her) [MV3 Debug Extension] Print `console` messages on test failure (#1961) 41e92be 2023-02-14 Anna Gringauze Create test_common package (#1945) 443f820 2023-02-14 Anna Gringauze Re-enable skipped reload test (#1958) a7bc3fc 2023-02-14 Anna Gringauze Make dart-uri-file-uri test use sound null safety (#1959) 464a8eb 2023-02-14 Elliott Brooks (she/her) [MV3 Debug Extension] Compile extension with Dart instead of shell script (#1954) 7cf8fe2 2023-02-13 Anna Gringauze Fix asset handler tests (#1956) c371ad7 2023-02-13 Anna Gringauze Fix chrome_proxy_service tests broken after switch to null safety by default (#1957) d6ec127 2023-02-13 Anna Gringauze Move test-only code from the SdkLayout (#1955) 35fa34b 2023-02-13 Elliott Brooks (she/her) [MV3 Debug Extension] Update Chrome APIs to be backwards compatible with MV2 (#1951) Change-Id: I4250594d0fa775d07cb3a0f8594e634552de452b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284240 Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
This issue was originally filed by [email protected]
The specification in the section 12.2 says: "It is compile time error if the value of an actual argument to the prefix combinator denotes a name that is declared by the importing library."
So, the following code should produce a compile-time error:
import("some_library.dart", prefix: "prefix");
main() {
int prefix;
try {
Expect.equals(1, prefix.foo);
} catch(var e) {}
}
But dartc(r8186) produces a static warning: "Local variable 'prefix' is hiding 'LIBRARY_PREFIX prefix' at <unknown>::0:0"
The text was updated successfully, but these errors were encountered: