Skip to content

When code completion includes an import, conflicting names are not considered #439

@eric-milles

Description

@eric-milles

Related to #367, #435 and #438 -- when code completion includes an import, conflicting names are not considered. This results in an import that shadows or is shadowed by another name in the scope.

//import static x.y.z.VALUE as NAME
//import static x.y.z.NAME
class C {
  //static Object NAME
  //Object NAME
  //static def NAME() {}
  // def NAME() {}
  void meth(/*def NAME*/) {
    //def NAME
   util(NA|) // completion on "NAME : E" proposal introduces static import that conflicts with any of the NAME declarations above
  }
  void util(E e) {}
}
package p;
enum E {
  NAME
}

A similar situation may exist if completion inserts "E.NAME" and "import p.E" and there is a name "E" in scope.

Partially- or fully-qualified names should be inserted in cases of conflict.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions