We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b53660a commit d83d09dCopy full SHA for d83d09d
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -396,9 +396,11 @@ class Typer extends Namer
396
}
397
else if (name.toTermName == nme.ERROR)
398
UnspecifiedErrorType
399
- else if (ctx.owner.isConstructor && ctx.owner.owner.unforcedDecls.toList.exists(_.name == tree.name))
+ 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
402
errorType(ex"$tree is not accessible from super constructor arguments", tree.pos)
- else
403
+ } else
404
errorType(new MissingIdent(tree, kind, name.show), tree.pos)
405
406
val tree1 = ownType match {
0 commit comments