diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 934a7567d5..1392f39c48 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4648,7 +4648,9 @@ trait Typers extends Modes with Adaptations with Taggings with PatMatVirtualiser typedValDef(vdef) case ddef @ DefDef(_, _, _, _, _, _) => - newTyper(context.makeNewScope(tree, sym)).typedDefDef(ddef) + // flag default getters for constructors. An actual flag would be nice. See SI-5543. + val flag = ddef.mods.hasDefaultFlag && nme.defaultGetterToMethod(sym.name) == nme.CONSTRUCTOR + newTyper(context.makeNewScope(tree, sym)).constrTyperIf(flag).typedDefDef(ddef) case tdef @ TypeDef(_, _, _, _) => typedTypeDef(tdef) |