diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t3927.scala | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index bf790301f5..cac788906b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -410,7 +410,7 @@ trait Namers { self: Analyzer => val vsym = if (!context.owner.isClass) { assert(mods1.isLazy) // if not a field, it has to be a lazy val - owner.newValue(tree.pos, name + "$lzy" ).setFlag(mods1.flags | MUTABLE) + owner.newValue(tree.pos, name + "$lzy" ).setFlag((mods1.flags | MUTABLE) & ~IMPLICIT) } else { val mFlag = if (mods1.isLazy) MUTABLE else 0 val lFlag = if (mods.hasFlag(PRIVATE) && mods.hasFlag(LOCAL)) 0 else LOCAL diff --git a/test/files/pos/t3927.scala b/test/files/pos/t3927.scala new file mode 100644 index 0000000000..c1344febba --- /dev/null +++ b/test/files/pos/t3927.scala @@ -0,0 +1,6 @@ +object A { + def x { + implicit lazy val e: Equiv[Int] = error("") + implicitly[Equiv[Int]] + } +} |