Skip to content

Commit 2f768f3

Browse files
committed
Fix exception: not all traits have constructors
ErasedFunctionX does not have constructors, thus no need to follow. dotc -d out -Yerased-terms -Ycheck-init tests/run-custom-args/erased/erased-15.scala
1 parent 1d9a840 commit 2f768f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ object Checking {
112112

113113
case ref =>
114114
val cls = ref.tpe.classSymbol.asClass
115-
if (!state.parentsInited.contains(cls))
115+
if (!state.parentsInited.contains(cls) && cls.primaryConstructor.exists)
116116
checkCtor(cls.primaryConstructor, ref.tpe, ref)
117117
}
118118

0 commit comments

Comments
 (0)