Skip to content

Commit 58c8dc1

Browse files
committed
Fix secondary constructor
1 parent 1a9b409 commit 58c8dc1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Checking.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ object Checking {
146146
}
147147

148148
def checkSecondaryConstructor(ctor: Symbol)(implicit state: State): Unit = traceOp("checking " + ctor.show, init) {
149-
val Block(ctorCall :: stats, expr) = ctor.defTree
149+
val Block(ctorCall :: stats, expr) = ctor.defTree.asInstanceOf[DefDef].rhs
150150
val cls = ctor.owner.asClass
151151

152-
traceOp("check ctor: " + ctor.show, init) {
152+
traceOp("check ctor: " + ctorCall.show, init) {
153+
val ctor = ctorCall.symbol
153154
if (ctor.isPrimaryConstructor)
154155
checkClassBody(cls.defTree.asInstanceOf[TypeDef])
155156
else

0 commit comments

Comments
 (0)