Skip to content

Commit 49ca76d

Browse files
committed
Black magic to make cps-async compile
1 parent dc51e78 commit 49ca76d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,18 @@ object Denotations {
489489
|| sym1.is(Method) && !sym2.is(Method)
490490
|| sym1.info.isErroneous)
491491

492-
if preferMethod(sym1, sym2) then denot1
492+
if sym1 eq sym2 then denot2
493+
// black magic to make cps-async compile. The problem lies elsewhere: the compiler
494+
// is not able to identify two types that should be the same. In
495+
//
496+
// trait ApplyTreeTransform[F[_],CT]:
497+
// thisTreeTransform: TreeTransformScope[F,CT] =>
498+
// It does not see that the `F` instances in `ApplyTreeTransform` and `TreeTransformScope`
499+
// are the same. It's actually not clear to me that they should be regarded as the same.
500+
else if preferMethod(sym1, sym2) then denot1
493501
else if preferMethod(sym2, sym1) then denot2
494502
else
495-
overload.println(i"overloaded with same signature: ${sym1.showLocated}: $info1 / ${sym2.showLocated}: $info2")
503+
println(i"overloaded with same signature: ${sym1.showLocated}: $info1 / ${sym2.showLocated}: $info2")
496504
MultiDenotation(denot1, denot2)
497505
end handleConflict
498506

0 commit comments

Comments
 (0)