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 1a9b409 commit 58c8dc1Copy full SHA for 58c8dc1
compiler/src/dotty/tools/dotc/transform/init/Checking.scala
@@ -146,10 +146,11 @@ object Checking {
146
}
147
148
def checkSecondaryConstructor(ctor: Symbol)(implicit state: State): Unit = traceOp("checking " + ctor.show, init) {
149
- val Block(ctorCall :: stats, expr) = ctor.defTree
+ val Block(ctorCall :: stats, expr) = ctor.defTree.asInstanceOf[DefDef].rhs
150
val cls = ctor.owner.asClass
151
152
- traceOp("check ctor: " + ctor.show, init) {
+ traceOp("check ctor: " + ctorCall.show, init) {
153
+ val ctor = ctorCall.symbol
154
if (ctor.isPrimaryConstructor)
155
checkClassBody(cls.defTree.asInstanceOf[TypeDef])
156
else
tests/init/neg/misc/second-ctor.scala renamed to tests/init/pos/second-ctor.scala
0 commit comments