@@ -1139,6 +1139,23 @@ class Definitions {
1139
1139
assocFile = denot.symbol.associatedFile
1140
1140
)
1141
1141
1142
+ def makeNonClassSymbol (patch : Symbol ) =
1143
+ if patch.is(Inline ) then
1144
+ // Inline symbols contain trees in annotations, which is coupled
1145
+ // with the underlying symbol.
1146
+ // Changing owner for inline symbols is a simple workaround.
1147
+ patch.denot = patch.denot.copySymDenotation(owner = denot.symbol)
1148
+ patch
1149
+ else
1150
+ // change `info` which might contain reference to the patch
1151
+ patch.copy(
1152
+ owner = denot.symbol,
1153
+ info =
1154
+ if patch.is(Module )
1155
+ then TypeRef (denot.symbol.thisType, patch.name.moduleClassName)
1156
+ else patch.info // assume non-object info does not refer to symbols in the patch
1157
+ )
1158
+
1142
1159
if patchCls.exists then
1143
1160
val patches = patchCls.info.decls.filter(patch =>
1144
1161
! patch.isConstructor && ! patch.isOneOf(PrivateOrSynthetic ))
@@ -1153,21 +1170,7 @@ class Definitions {
1153
1170
case ClassInfo (_, _, parents, _, selfInfo) =>
1154
1171
makeClassSymbol(patch, parents, selfInfo)
1155
1172
case _ =>
1156
- if patch.is(Inline ) then
1157
- // Inline symbols contain trees in definitions, which is coupled
1158
- // with the underlying symbol.
1159
- // Changing owner for inline symbols is a simple workaround.
1160
- patch.denot = patch.denot.copySymDenotation(owner = denot.symbol)
1161
- patch
1162
- else
1163
- // change `info` which might contain reference to the patch
1164
- patch.copy(
1165
- owner = denot.symbol,
1166
- info =
1167
- if patch.is(Module )
1168
- then TypeRef (denot.symbol.thisType, patch.name.moduleClassName)
1169
- else patch.info // assume non-object info does not refer to symbols in the patch
1170
- )
1173
+ makeNonClassSymbol(patch)
1171
1174
end match
1172
1175
sym.annotations = patch.annotations
1173
1176
scope.enter(sym)
0 commit comments