Skip to content

Commit 91cf80d

Browse files
committed
Address review comments
1 parent 9878eb1 commit 91cf80d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
223223
tp2 match {
224224
case tp2 @ TypeRef(pre2, _) if tp1.name eq tp2.name =>
225225
tp1.derivedSelect(pre1 | pre2)
226-
case _ => fail
226+
case _ => fallback
227227
}
228228
case AndType(tp11, tp12) =>
229229
mergeRefinedOrApplied(tp11, tp2) & mergeRefinedOrApplied(tp12, tp2)

tests/pos/i7965.scala

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ abstract class Test {
1111
foo(x)
1212
}
1313

14+
// -------------------------------------------
15+
1416
trait ZLayer[-RIn, +E, +ROut <: Has[_]] {
1517
def >>>[E1 >: E, ROut2 <: Has[_]](that: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2]
1618
def ++[E1 >: E, RIn2, ROut1 >: ROut <: Has[_], ROut2 <: Has[_]](that: ZLayer[RIn2, E1, ROut2]): ZLayer[RIn with RIn2, E1, ROut1 with ROut2]
@@ -45,4 +47,20 @@ object ServiceD {
4547

4648
val combined =
4749
ServiceA.live >>>
48-
(ServiceB.live ++ (ServiceC.live >>> ServiceD.live))
50+
(ServiceB.live ++ (ServiceC.live >>> ServiceD.live))
51+
52+
// -------------------------------------------
53+
54+
class Outer {
55+
class Elem
56+
}
57+
58+
abstract class Test2 {
59+
val o1: Outer = ???
60+
val o2: Outer = ???
61+
val o3: Outer = ???
62+
63+
val x: o1.Elem | (o2.Elem & o3.Elem)
64+
def foo[T <: Outer#Elem](has: T): T = ???
65+
foo(x)
66+
}

0 commit comments

Comments
 (0)