Skip to content

Commit cd6341e

Browse files
committed
Enhance -Ycheck to check all members
1 parent 5a6fbc2 commit cd6341e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,18 +426,19 @@ class TreeChecker extends Phase with SymTransformer {
426426
checkOwner(impl)
427427
checkOwner(impl.constr)
428428

429-
def isNonMagicalMethod(x: Symbol) =
430-
x.is(Method) &&
429+
def isNonMagicalMember(x: Symbol) =
431430
!x.isValueClassConvertMethod &&
432-
!(x.is(Macro) && ctx.phase.refChecked) &&
433431
!x.name.is(DocArtifactName)
434432

435-
val symbolsNotDefined = cls.classInfo.decls.toList.toSet.filter(isNonMagicalMethod) -- impl.body.map(_.symbol) - constr.symbol
433+
val decls = cls.classInfo.decls.toList.toSet.filter(isNonMagicalMember)
434+
val defined = impl.body.map(_.symbol)
435+
436+
val symbolsNotDefined = decls -- defined - constr.symbol
436437

437438
assert(symbolsNotDefined.isEmpty,
438439
i" $cls tree does not define methods: ${symbolsNotDefined.toList}%, %\n" +
439-
i"expected: ${cls.classInfo.decls.toList.toSet.filter(isNonMagicalMethod)}%, %\n" +
440-
i"defined: ${impl.body.map(_.symbol)}%, %")
440+
i"expected: $decls%, %\n" +
441+
i"defined: $defined%, %")
441442

442443
super.typedClassDef(cdef, cls)
443444
}

0 commit comments

Comments
 (0)