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