diff options
3 files changed, 19 insertions, 4 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala index 6c8719b5eb..d6be6331ce 100644 --- a/src/interactive/scala/tools/nsc/interactive/Global.scala +++ b/src/interactive/scala/tools/nsc/interactive/Global.scala @@ -1000,7 +1000,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") def add(sym: Symbol, pre: Type, implicitlyAdded: Boolean)(toMember: (Symbol, Type) => M) { if ((sym.isGetter || sym.isSetter) && sym.accessed != NoSymbol) { add(sym.accessed, pre, implicitlyAdded)(toMember) - } else if (!sym.name.decodedName.containsName("$") && !sym.isSynthetic && sym.hasRawInfo) { + } else if (!sym.name.decodedName.containsName("$") && !sym.isError && !sym.isArtifact && sym.hasRawInfo) { val symtpe = pre.memberType(sym) onTypeError ErrorType matching(sym, symtpe, this(sym.name)) match { case Some(m) => diff --git a/test/files/presentation/callcc-interpreter.check b/test/files/presentation/callcc-interpreter.check index 4bf68b3d4e..94a3d64d68 100644 --- a/test/files/presentation/callcc-interpreter.check +++ b/test/files/presentation/callcc-interpreter.check @@ -3,7 +3,7 @@ reload: CallccInterpreter.scala askTypeCompletion at CallccInterpreter.scala(51,34) ================================================================================ [response] askTypeCompletion at (51,34) -retrieved 57 members +retrieved 66 members abstract trait Term extends AnyRef abstract trait Value extends AnyRef case class Add extends callccInterpreter.Term with Product with Serializable @@ -50,6 +50,15 @@ final def synchronized[T0](x$1: T0): T0 final def wait(): Unit final def wait(x$1: Long): Unit final def wait(x$1: Long,x$2: Int): Unit +object Add +object App +object Ccc +object Con +object Fun +object Lam +object M +object Num +object Var private[this] val term0: callccInterpreter.App private[this] val term1: callccInterpreter.App private[this] val term2: callccInterpreter.Add diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala index 5b35c37c7f..177d4922fb 100644 --- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala @@ -81,6 +81,12 @@ class CompletionTest { checkExact(completer, "new C().x_y")("x_y_z") checkExact(completer, "(1 : O.T).toCha")("toChar") + + intp.interpret("case class X_y_z()") + val completer1 = new PresentationCompilerCompleter(intp) + checkExact(completer1, "new X_y_")("X_y_z") + checkExact(completer1, "X_y_")("X_y_z") + checkExact(completer1, "X_y_z.app")("apply") } @Test @@ -137,8 +143,8 @@ class CompletionTest { def firstCompletionWithNoPrefixHidesUniversalMethodsAndExtensionMethods(): Unit = { val intp = newIMain() val completer = new PresentationCompilerCompleter(intp) - checkExact(completer, "case class C(a: Int, b: Int) { this.")("a", "b") - assert(Set("asInstanceOf", "==").diff(completer.complete("case class C(a: Int, b: Int) { this.").candidates.toSet).isEmpty) + checkExact(completer, "class C(val a: Int, val b: Int) { this.")("a", "b") + assert(Set("asInstanceOf", "==").diff(completer.complete("class C(val a: Int, val b: Int) { this.").candidates.toSet).isEmpty) checkExact(completer, "case class D(a: Int, b: Int) { this.a")("a", "asInstanceOf") } |