File tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -5579,7 +5579,7 @@ object Types extends TypeUtils {
5579
5579
def withRefinements (toType : Type , fromTp : Type ): Type = fromTp.dealias match
5580
5580
case RefinedType (fromParent, name, info : AliasingBounds ) if tp0.member(name).exists =>
5581
5581
val parent1 = withRefinements(toType, fromParent)
5582
- RefinedType (toType , name, info)
5582
+ RefinedType (parent1 , name, info)
5583
5583
case _ => toType
5584
5584
val tp = withRefinements(tp0, origTp)
5585
5585
Original file line number Diff line number Diff line change @@ -7,9 +7,16 @@ trait Sam2:
7
7
type T
8
8
def apply (x : T ): T
9
9
10
+ trait Sam3 :
11
+ type T
12
+ type U
13
+ def apply (x : T ): U
14
+
10
15
object Test :
11
16
def main (args : Array [String ]): Unit =
12
17
val s1 : Sam1 { type T = String } = x => x.trim
13
18
s1.apply(" foo" )
14
19
val s2 : Sam2 { type T = Int } = x => x + 1
15
20
s2.apply(1 )
21
+ val s3 : Sam3 { type T = Int ; type U = String } = x => x.toString
22
+ s3.apply(2 )
You can’t perform that action at this time.
0 commit comments