diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 2 | ||||
-rw-r--r-- | test/files/neg/t1168.check | 4 | ||||
-rw-r--r-- | test/files/neg/t1168.scala | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index bf7c3f564b..a87dda4447 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -496,7 +496,7 @@ trait Contexts { self: Analyzer => implicitsCache = null if (outer != null && outer != this) outer.resetCache } - private def collectImplicits(syms: List[Symbol], pre: Type): List[ImplicitInfo] = { + private def collectImplicits(syms: List[Symbol], pre: Type): List[ImplicitInfo] = for (sym <- syms if sym.hasFlag(IMPLICIT) && isAccessible(sym, pre, false)) yield new ImplicitInfo(sym.name, pre, sym) diff --git a/test/files/neg/t1168.check b/test/files/neg/t1168.check new file mode 100644 index 0000000000..d9b754774f --- /dev/null +++ b/test/files/neg/t1168.check @@ -0,0 +1,4 @@ +t1168.scala:6: error: Names of vals or vars may not end in `_=' + val r_= = 4 + ^ +one error found diff --git a/test/files/neg/t1168.scala b/test/files/neg/t1168.scala new file mode 100644 index 0000000000..85f2dc90d2 --- /dev/null +++ b/test/files/neg/t1168.scala @@ -0,0 +1,7 @@ +class tor { + def r_= = 4 +} + +class child extends tor { + val r_= = 4 +} |