File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 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 {
55795579 def withRefinements (toType : Type , fromTp : Type ): Type = fromTp.dealias match
55805580 case RefinedType (fromParent, name, info : AliasingBounds ) if tp0.member(name).exists =>
55815581 val parent1 = withRefinements(toType, fromParent)
5582- RefinedType (toType , name, info)
5582+ RefinedType (parent1 , name, info)
55835583 case _ => toType
55845584 val tp = withRefinements(tp0, origTp)
55855585
Original file line number Diff line number Diff line change @@ -7,9 +7,16 @@ trait Sam2:
77 type T
88 def apply (x : T ): T
99
10+ trait Sam3 :
11+ type T
12+ type U
13+ def apply (x : T ): U
14+
1015object Test :
1116 def main (args : Array [String ]): Unit =
1217 val s1 : Sam1 { type T = String } = x => x.trim
1318 s1.apply(" foo" )
1419 val s2 : Sam2 { type T = Int } = x => x + 1
1520 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