dartc doesn't namespace private globals in libraries #336
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
closed-invalid
Closed as we don't believe the reported issue is generally actionable
Milestone
This issue was originally filed by [email protected]
Consider these two libraries:
-- a.dart--
library("a");
final _private = 42;
afn ()=>_private;
-- b.dart--
library("b");
final _private = 22;
bfn () =>_private;
and a consumer:
--- import_dartc.dart ---
import("a.dart");
import("b.dart");
main() {
print(afn());
print(bfn());
}
With dart_bin this runs ok:
krukow:~/scratchpad$ dart_bin import_dartc.dart
42
22
With dartc we get a conflict:
krukow:~/scratchpad$ dartc import_dartc.dart
a.dart/a.dart:2: duplicate definition of _private
1: #library("a");
2: final _private = 42;
b.dart/b.dart:2: duplicate definition of _private
1: #library("b");
2: final _private = 22;
The text was updated successfully, but these errors were encountered: