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 a80a11e commit 864f81dCopy full SHA for 864f81d
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -440,8 +440,8 @@ object Checking {
440
}
441
if (sym.isValueClass && sym.is(Trait) && !sym.isRefinementClass)
442
fail(CannotExtendAnyVal(sym))
443
- if (sym.isConstructor && !sym.isPrimaryConstructor && sym.owner.is(Trait))
444
- fail("Traits cannot have secondary constructors")
+ if (sym.isConstructor && !sym.isPrimaryConstructor && sym.owner.is(Trait, butNot = JavaDefined))
+ fail("Traits cannot have secondary constructors " + sym.owner.flagsString)
445
checkCombination(Final, Open)
446
checkCombination(Sealed, Open)
447
checkCombination(Final, Sealed)
0 commit comments