Skip to content

Commit ccb4f8a

Browse files
committed
Fix problem in TermRef.alternatives
Rewrap needs to produce alternatives with signatures. Otgerwise the new denotation will simply overwrite the old because both the overloaded TermRef and the alternative will hash to the same unique TermRef.
1 parent 3a503cf commit ccb4f8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ object Types {
11401140
override def isOverloaded(implicit ctx: Context) = denot.isOverloaded
11411141

11421142
private def rewrap(sd: SingleDenotation)(implicit ctx: Context) =
1143-
TermRef(prefix, name, sd)
1143+
TermRef.withSig(prefix, name, sd.signature, sd)
11441144

11451145
def alternatives(implicit ctx: Context): List[TermRef] =
11461146
denot.alternatives map rewrap

0 commit comments

Comments
 (0)