Skip to content

Commit d1cbc62

Browse files
committed
Optimization: Only expand line accessor names in extensible classes
1 parent 7bae75d commit d1cbc62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ object PrepareInlineable {
5454
*/
5555
abstract class MakeInlineableMap(val inlineSym: Symbol) extends TreeMap with Insert {
5656
def accessorNameOf(name: TermName, site: Symbol)(using Context): TermName =
57-
InlineAccessorName(name).expandedName(site)
57+
val accName = InlineAccessorName(name)
58+
if site.isExtensibleClass then accName.expandedName(site) else accName
5859

5960
/** A definition needs an accessor if it is private, protected, or qualified private
6061
* and it is not part of the tree that gets inlined. The latter test is implemented

0 commit comments

Comments
 (0)