@@ -101,15 +101,17 @@ class TreeChecker {
101
101
def ownerMatches (symOwner : Symbol , ctxOwner : Symbol ): Boolean =
102
102
symOwner == ctxOwner ||
103
103
ctxOwner.isWeakOwner && ownerMatches(symOwner, ctxOwner.owner)
104
- if (! ownerMatches(tree.symbol.owner, ctx.owner)) {
105
- assert(ownerMatches(tree.symbol.owner, ctx.owner),
106
- i " bad owner; ${tree.symbol} has owner ${tree.symbol.owner}, expected was ${ctx.owner}\n " +
107
- i " owner chain = ${tree.symbol.ownersIterator.toList}%, %, ctxOwners = ${ctx.outersIterator.map(_.owner).toList}%, % " )
108
- }
104
+ assert(ownerMatches(tree.symbol.owner, ctx.owner),
105
+ i " bad owner; ${tree.symbol} has owner ${tree.symbol.owner}, expected was ${ctx.owner}\n " +
106
+ i " owner chain = ${tree.symbol.ownersIterator.toList}%, %, ctxOwners = ${ctx.outersIterator.map(_.owner).toList}%, % " )
109
107
}
110
108
111
109
override def typedClassDef (cdef : untpd.TypeDef , cls : ClassSymbol )(implicit ctx : Context ) = {
112
110
val TypeDef (_, _, impl @ Template (constr, _, _, _)) = cdef
111
+ assert(cdef.symbol == cls)
112
+ assert(impl.symbol.owner == cls)
113
+ assert(constr.symbol.owner == cls)
114
+ assert(cls.primaryConstructor == constr.symbol, i " mismatch, primary constructor ${cls.primaryConstructor}, in tree = ${constr.symbol}" )
113
115
checkOwner(impl)
114
116
checkOwner(impl.constr)
115
117
super .typedClassDef(cdef, cls)
0 commit comments