@@ -12,9 +12,9 @@ trait Substituters { this: Context =>
12
12
case tp : BoundType =>
13
13
if (tp.binder eq from) tp.copyBoundType(to.asInstanceOf [tp.BT ]) else tp
14
14
case tp : NamedType =>
15
- if (tp.currentSymbol.isStatic) tp
15
+ if (tp.currentSymbol.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
16
16
else tp.derivedSelect(subst(tp.prefix, from, to, theMap))
17
- case _ : ThisType | NoPrefix =>
17
+ case _ : ThisType =>
18
18
tp
19
19
case _ =>
20
20
(if (theMap != null ) theMap else new SubstBindingMap (from, to))
@@ -26,9 +26,9 @@ trait Substituters { this: Context =>
26
26
case tp : NamedType =>
27
27
val sym = tp.symbol
28
28
if (sym eq from) return to
29
- if (sym.isStatic && ! from.isStatic) tp
29
+ if (sym.isStatic && ! from.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
30
30
else tp.derivedSelect(subst1(tp.prefix, from, to, theMap))
31
- case _ : ThisType | _ : BoundType | NoPrefix =>
31
+ case _ : ThisType | _ : BoundType =>
32
32
tp
33
33
case _ =>
34
34
(if (theMap != null ) theMap else new Subst1Map (from, to))
@@ -42,9 +42,9 @@ trait Substituters { this: Context =>
42
42
val sym = tp.symbol
43
43
if (sym eq from1) return to1
44
44
if (sym eq from2) return to2
45
- if (sym.isStatic && ! from1.isStatic && ! from2.isStatic) tp
45
+ if (sym.isStatic && ! from1.isStatic && ! from2.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
46
46
else tp.derivedSelect(subst2(tp.prefix, from1, to1, from2, to2, theMap))
47
- case _ : ThisType | _ : BoundType | NoPrefix =>
47
+ case _ : ThisType | _ : BoundType =>
48
48
tp
49
49
case _ =>
50
50
(if (theMap != null ) theMap else new Subst2Map (from1, to1, from2, to2))
@@ -63,9 +63,9 @@ trait Substituters { this: Context =>
63
63
fs = fs.tail
64
64
ts = ts.tail
65
65
}
66
- if (sym.isStatic && ! existsStatic(from)) tp
66
+ if (sym.isStatic && ! existsStatic(from) || (tp.prefix `eq` NoPrefix ) ) tp
67
67
else tp.derivedSelect(subst(tp.prefix, from, to, theMap))
68
- case _ : ThisType | _ : BoundType | NoPrefix =>
68
+ case _ : ThisType | _ : BoundType =>
69
69
tp
70
70
case _ =>
71
71
(if (theMap != null ) theMap else new SubstMap (from, to))
@@ -84,7 +84,7 @@ trait Substituters { this: Context =>
84
84
fs = fs.tail
85
85
ts = ts.tail
86
86
}
87
- if (sym.isStatic && ! existsStatic(from)) tp
87
+ if (sym.isStatic && ! existsStatic(from) || (tp.prefix `eq` NoPrefix ) ) tp
88
88
else {
89
89
tp.info match {
90
90
case TypeAlias (alias) =>
@@ -94,7 +94,7 @@ trait Substituters { this: Context =>
94
94
}
95
95
tp.derivedSelect(substDealias(tp.prefix, from, to, theMap))
96
96
}
97
- case _ : ThisType | _ : BoundType | NoPrefix =>
97
+ case _ : ThisType | _ : BoundType =>
98
98
tp
99
99
case _ =>
100
100
(if (theMap != null ) theMap else new SubstDealiasMap (from, to))
@@ -114,7 +114,7 @@ trait Substituters { this: Context =>
114
114
fs = fs.tail
115
115
ts = ts.tail
116
116
}
117
- if (sym.isStatic && ! existsStatic(from)) tp
117
+ if (sym.isStatic && ! existsStatic(from) || (tp.prefix `eq` NoPrefix ) ) tp
118
118
else tp.derivedSelect(substSym(tp.prefix, from, to, theMap))
119
119
case tp : ThisType =>
120
120
val sym = tp.cls
@@ -126,7 +126,7 @@ trait Substituters { this: Context =>
126
126
ts = ts.tail
127
127
}
128
128
tp
129
- case _ : ThisType | _ : BoundType | NoPrefix =>
129
+ case _ : ThisType | _ : BoundType =>
130
130
tp
131
131
case _ =>
132
132
(if (theMap != null ) theMap else new SubstSymMap (from, to))
@@ -138,9 +138,9 @@ trait Substituters { this: Context =>
138
138
case tp : ThisType =>
139
139
if (tp.cls eq from) to else tp
140
140
case tp : NamedType =>
141
- if (tp.currentSymbol.isStaticOwner) tp
141
+ if (tp.currentSymbol.isStaticOwner || (tp.prefix `eq` NoPrefix ) ) tp
142
142
else tp.derivedSelect(substThis(tp.prefix, from, to, theMap))
143
- case _ : BoundType | NoPrefix =>
143
+ case _ : BoundType =>
144
144
tp
145
145
case _ =>
146
146
(if (theMap != null ) theMap else new SubstThisMap (from, to))
@@ -152,9 +152,9 @@ trait Substituters { this: Context =>
152
152
case tp @ RecThis (binder) =>
153
153
if (binder eq from) to else tp
154
154
case tp : NamedType =>
155
- if (tp.currentSymbol.isStatic) tp
155
+ if (tp.currentSymbol.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
156
156
else tp.derivedSelect(substRecThis(tp.prefix, from, to, theMap))
157
- case _ : ThisType | _ : BoundType | NoPrefix =>
157
+ case _ : ThisType | _ : BoundType =>
158
158
tp
159
159
case _ =>
160
160
(if (theMap != null ) theMap else new SubstRecThisMap (from, to))
@@ -166,9 +166,9 @@ trait Substituters { this: Context =>
166
166
case tp : BoundType =>
167
167
if (tp == from) to else tp
168
168
case tp : NamedType =>
169
- if (tp.currentSymbol.isStatic) tp
169
+ if (tp.currentSymbol.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
170
170
else tp.derivedSelect(substParam(tp.prefix, from, to, theMap))
171
- case _ : ThisType | NoPrefix =>
171
+ case _ : ThisType =>
172
172
tp
173
173
case _ =>
174
174
(if (theMap != null ) theMap else new SubstParamMap (from, to))
@@ -180,9 +180,9 @@ trait Substituters { this: Context =>
180
180
case tp : ParamRef =>
181
181
if (tp.binder == from) to(tp.paramNum) else tp
182
182
case tp : NamedType =>
183
- if (tp.currentSymbol.isStatic) tp
183
+ if (tp.currentSymbol.isStatic || (tp.prefix `eq` NoPrefix ) ) tp
184
184
else tp.derivedSelect(substParams(tp.prefix, from, to, theMap))
185
- case _ : ThisType | NoPrefix =>
185
+ case _ : ThisType =>
186
186
tp
187
187
case _ =>
188
188
(if (theMap != null ) theMap else new SubstParamsMap (from, to))
0 commit comments