File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -396,9 +396,11 @@ class Typer extends Namer
396396 }
397397 else if (name.toTermName == nme.ERROR )
398398 UnspecifiedErrorType
399- else if (ctx.owner.isConstructor && ctx.owner.owner.unforcedDecls.toList.exists(_.name == tree.name))
399+ else if (ctx.owner.isConstructor && ctx.owner.owner.unforcedDecls.lookup(tree.name).exists) {
400+ // If the field existed but was not found we assume that
401+ // we where in the context of an argument of the super constructor
400402 errorType(ex " $tree is not accessible from super constructor arguments " , tree.pos)
401- else
403+ } else
402404 errorType(new MissingIdent (tree, kind, name.show), tree.pos)
403405
404406 val tree1 = ownType match {
You can’t perform that action at this time.
0 commit comments