Skip to content

Commit c7f1f35

Browse files
committed
Adress reviewers comments
1 parent 10d868c commit c7f1f35

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
13311331
}
13321332
if (homogenizeArgs &&
13331333
isNonvariantAlias(rinfo1) && isNonvariantAlias(rinfo2))
1334-
isSameType(rinfo1, rinfo2)
1334+
isSameType(rinfo1, rinfo2) // establish new constraint
13351335

13361336
tp1.derivedRefinedType(parent, tp1.refinedName, rinfo1 & rinfo2)
13371337
case _ =>

tests/pending/pos/depmet_implicit_oopsla_session_2.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
// Fails on line 70 with: no implicit argument of type Sessions.Session[
2+
// | Sessions.In[Int, Sessions.In[Int, Sessions.Out[Int, Sessions.Stop]]]^
3+
// |]#HasDual[Sessions.Out[Int, Sessions.Out[Int, Sessions.In[Int, Sessions.Stop]]]^
4+
// | ] found for parameter evidence$1 of method runSession in object Sessions
5+
// This could be related to existential types (the # essentially boils down to one).
16
object Sessions {
7+
def ?[T <: AnyRef](implicit w: T): w.type = w
28

39
// session states
410
sealed case class Stop()
@@ -17,7 +23,7 @@ object Sessions {
1723

1824
// friendly interface to the theory
1925
def runSession[S, D: Session[S]#HasDual](session: S, dual: D) =
20-
implicitly[Session[S]#HasDual[D]].run(session, dual)
26+
?[Session[S]#HasDual[D]].run(session, dual)
2127

2228
// facts in the theory:
2329

0 commit comments

Comments
 (0)