File tree 2 files changed +15
-6
lines changed
src/dotty/tools/dotc/typer 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,15 @@ trait TypeAssigner {
88
88
case _ =>
89
89
mapOver(tp)
90
90
}
91
- case tp : RefinedType =>
92
- val tp1 @ RefinedType ( parent1, _) = mapOver (tp)
93
- if (tp1 .refinedInfo.existsPart(toAvoid) && variance > 0 ) {
94
- typr.println(s " dropping refinement from $tp1 " )
91
+ case tp : RefinedType if variance > 0 =>
92
+ val parent1 = apply (tp.parent )
93
+ if (tp .refinedInfo.existsPart(toAvoid)) {
94
+ typr.println(s " dropping refinement from $tp " )
95
95
parent1
96
- }
97
- else tp1
96
+ } else if (parent1 != tp.parent) {
97
+ tp.baseTypeWithArgs(parent1.classSymbol)
98
+ } else
99
+ tp
98
100
case tp : TypeVar if ctx.typerState.constraint.contains(tp) =>
99
101
val lo = ctx.typerState.constraint.fullLowerBound(tp.origin)
100
102
val lo1 = avoid(lo, symsToAvoid)
Original file line number Diff line number Diff line change
1
+ class Foo [A ]
2
+
1
3
class Outer {
2
4
class Inner
3
5
}
@@ -8,5 +10,10 @@ object Test {
8
10
val o = new Outer
9
11
new o.Inner
10
12
}
13
+
14
+ val b = {
15
+ class Bar [B ] extends Foo [B ]
16
+ new Bar [Int ]
17
+ }
11
18
}
12
19
}
You can’t perform that action at this time.
0 commit comments