Skip to content

Commit 236fb32

Browse files
committed
After-rebase fix: weaken owner-chain restriction.
Allow to skip labels.
1 parent 9ab1568 commit 236fb32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class TreeChecker {
9898
private def checkOwner(tree: untpd.Tree)(implicit ctx: Context): Unit = {
9999
def ownerMatches(symOwner: Symbol, ctxOwner: Symbol): Boolean =
100100
symOwner == ctxOwner ||
101-
ctxOwner.isWeakOwner && !(ctxOwner is Method | Lazy | Mutable) &&
101+
ctxOwner.isTerm && (!(ctxOwner is Method | Lazy | Mutable) || (ctxOwner is Label)) &&
102102
ownerMatches(symOwner, ctxOwner.owner)
103103
if(!ownerMatches(tree.symbol.owner, ctx.owner)) {
104104
assert(ownerMatches(tree.symbol.owner, ctx.owner),

0 commit comments

Comments
 (0)