-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Milestone
Description
Member vars and vals appears in scope completion results, even if they are shadowed by local vars or vals.
The following presentation compiler partest
package test
class Completion2 {
val v1 = 0
var r1 = 1
def f1 = 2
type t1 = Int
def foo {
// local declarations shadow imported members
val v1 = "a"
var r1 = "b"
def f1 = "c"
type t1 = String
/*_*/
}
}generates this output
reload: Completion.scala, Test.scala
askScopeCompletion at Completion.scala(18,4)
================================================================================
[response] askScopeCompletion at (18,4)
retrieved 9 members
class Completion2 extends AnyRef
def <init>(): test.Completion2
def f1: String
def foo: Unit
private[this] val v1: Int
private[this] var r1: Int
type t1 = t1
val v1: String
var r1: String
================================================================================
v1 and r1 are listed twice, once for the local variables, once for the class members. f1 and t1 correctly appear only once.
The problem is in the Members.addNonShadowed() method. It checks for duplicated names, but doesn't handle the fact that members vars and vals contains an extra space in their name.
Reactions are currently unavailable