Skip to content

Commit 09cb925

Browse files
committed
Add skipLocalOwners
1 parent 0b072d6 commit 09cb925

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,11 @@ object SymDenotations {
11101110
enclClass(symbol, false)
11111111
}
11121112

1113+
/** Skips symbol that are not owned by a class */
1114+
def skipLocalOwners(using Context): Symbol =
1115+
if symbol.owner.isClass then symbol
1116+
else symbol.owner.skipLocalOwners
1117+
11131118
/** A class that in source code would be lexically enclosing */
11141119
final def lexicallyEnclosingClass(using Context): Symbol =
11151120
if (!exists || isClass) symbol else owner.lexicallyEnclosingClass

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ trait QuotesAndSplices {
7070
}
7171

7272
private def makeInlineable(tree: Tree)(using Context): Tree =
73-
def quoteOwner(sym: Symbol): Symbol =
74-
if sym.owner.isClass then sym else quoteOwner(sym.owner)
75-
inContext(ctx.withOwner(quoteOwner(ctx.owner))) {
73+
inContext(ctx.withOwner(ctx.owner.skipLocalOwners)) {
7674
PrepareInlineable.makeInlineable(tree)
7775
}
7876

0 commit comments

Comments
 (0)