File tree 1 file changed +10
-1
lines changed
src/dotty/tools/dotc/core
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,13 @@ object NameOps {
184
184
* an encoded name, e.g. super$$plus$eq. See #765.
185
185
*/
186
186
def unexpandedName : N = {
187
- val idx = name.lastIndexOfSlice(nme.EXPAND_SEPARATOR )
187
+ var idx = name.lastIndexOfSlice(nme.EXPAND_SEPARATOR )
188
+
189
+ // Hack to make super accessors from traits work. They would otherwise fail because of #765
190
+ // TODO: drop this once we have more robust name handling
191
+ if (name.slice(idx - FalseSuperLength , idx) == FalseSuper )
192
+ idx -= FalseSuper .length
193
+
188
194
if (idx < 0 ) name else (name drop (idx + nme.EXPAND_SEPARATOR .length)).asInstanceOf [N ]
189
195
}
190
196
@@ -436,4 +442,7 @@ object NameOps {
436
442
name.dropRight(nme.LAZY_LOCAL .length)
437
443
}
438
444
}
445
+
446
+ private final val FalseSuper = " $$super" .toTermName
447
+ private val FalseSuperLength = FalseSuper .length
439
448
}
You can’t perform that action at this time.
0 commit comments