Skip to content

Commit c855812

Browse files
authored
Merge pull request #11927 from dotty-staging/fix-11731
Fix #11731: Remove symbols with targetName correctly
2 parents bcf6c72 + 97ee5c0 commit c855812

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,9 @@ object SymDenotations {
18991899
* someone does a findMember on a subclass.
19001900
*/
19011901
def delete(sym: Symbol)(using Context): Unit = {
1902-
info.decls.openForMutations.unlink(sym)
1902+
val scope = info.decls.openForMutations
1903+
scope.unlink(sym, sym.name)
1904+
if sym.name != sym.originalName then scope.unlink(sym, sym.originalName)
19031905
if (myMemberCache != null) myMemberCache.remove(sym.name)
19041906
if (!sym.flagsUNSAFE.is(Private)) invalidateMemberNamesCache()
19051907
}

tests/pos/i11731.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import scala.annotation.targetName
2+
3+
trait Example:
4+
@targetName("funfun")
5+
inline def fun: Unit = ???

0 commit comments

Comments
 (0)