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
396
396
}
397
397
else if (name.toTermName == nme.ERROR )
398
398
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
400
402
errorType(ex " $tree is not accessible from super constructor arguments " , tree.pos)
401
- else
403
+ } else
402
404
errorType(new MissingIdent (tree, kind, name.show), tree.pos)
403
405
404
406
val tree1 = ownType match {
You can’t perform that action at this time.
0 commit comments