File tree 3 files changed +45
-4
lines changed
compiler/src/dotty/tools/dotc/core
3 files changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -589,13 +589,14 @@ object Types {
589
589
590
590
def goRefined (tp : RefinedType ) = {
591
591
val pdenot = go(tp.parent)
592
+ val pinfo = pdenot.info
592
593
val rinfo = tp.refinedInfo
593
- if (name.isTypeName) { // simplified case that runs more efficiently
594
+ if (name.isTypeName && ! pinfo. isInstanceOf [ ClassInfo ] ) { // simplified case that runs more efficiently
594
595
val jointInfo =
595
596
if (rinfo.isAlias) rinfo
596
- else if (pdenot.info. isAlias) pdenot.info
597
- else if (ctx.pendingMemberSearches.contains(name)) pdenot.info safe_& rinfo
598
- else pdenot.info recoverable_& rinfo
597
+ else if (pinfo. isAlias) pinfo
598
+ else if (ctx.pendingMemberSearches.contains(name)) pinfo safe_& rinfo
599
+ else pinfo recoverable_& rinfo
599
600
pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, jointInfo)
600
601
} else {
601
602
pdenot & (
Original file line number Diff line number Diff line change
1
+ trait x0 {
2
+ class x1 (x1: x0
3
+ {
4
+ type x1 <: List [x1 <: // error // error
Original file line number Diff line number Diff line change
1
+ object Test {
2
+
3
+ class C {
4
+
5
+ class I
6
+
7
+ }
8
+
9
+ trait T
10
+
11
+ val x : C { type I <: T } = ??? // direct refinement of class member
12
+
13
+ val y : x.I = ???
14
+
15
+ }
16
+
17
+ class B {
18
+ class C {
19
+ type I
20
+ }
21
+ trait T
22
+
23
+ type CC <: C
24
+
25
+ val x : CC { type I <: T } = ???
26
+ }
27
+
28
+ object Test2 extends B {
29
+
30
+ class CC extends C { class I }
31
+
32
+ val y : x.I = ??? // indirect refinement of class member
33
+
34
+
35
+ }
36
+
You can’t perform that action at this time.
0 commit comments