We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ab1568 commit 236fb32Copy full SHA for 236fb32
src/dotty/tools/dotc/transform/TreeChecker.scala
@@ -98,7 +98,7 @@ class TreeChecker {
98
private def checkOwner(tree: untpd.Tree)(implicit ctx: Context): Unit = {
99
def ownerMatches(symOwner: Symbol, ctxOwner: Symbol): Boolean =
100
symOwner == ctxOwner ||
101
- ctxOwner.isWeakOwner && !(ctxOwner is Method | Lazy | Mutable) &&
+ ctxOwner.isTerm && (!(ctxOwner is Method | Lazy | Mutable) || (ctxOwner is Label)) &&
102
ownerMatches(symOwner, ctxOwner.owner)
103
if(!ownerMatches(tree.symbol.owner, ctx.owner)) {
104
assert(ownerMatches(tree.symbol.owner, ctx.owner),
0 commit comments