Skip to content

Commit b756cf9

Browse files
noti0na1tgodzik
authored andcommitted
Cleanup the info of a Bind symbol in posttyper
[Cherry-picked c0abb05]
1 parent 1dc6c7c commit b756cf9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
458458
case _ =>
459459
processMemberDef(super.transform(tree))
460460
case tree: Bind =>
461-
if tree.symbol.isType && !tree.symbol.name.is(WildcardParamName) then
462-
Checking.checkGoodBounds(tree.symbol)
461+
val sym = tree.symbol
462+
if sym.isType && !sym.name.is(WildcardParamName) then
463+
Checking.checkGoodBounds(sym)
464+
// Cleanup retains from the info of the Bind symbol
465+
sym.copySymDenotation(info = transformAnnotsIn(CleanupRetains()(sym.info))).installAfter(thisPhase)
463466
super.transform(tree)
464467
case tree: New if isCheckable(tree) =>
465468
Checking.checkInstantiable(tree.tpe, tree.tpe, tree.srcPos)

0 commit comments

Comments
 (0)