Skip to content

Dartc: conflict of a library prefix and a name in the importing library should produce a compile error #3340

Closed
@DartBot

Description

@DartBot

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


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"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions