@@ -12,7 +12,7 @@ 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. prefix `eq` NoPrefix ) ) tp
15
+ if (tp.prefix `eq` NoPrefix ) tp
16
16
else tp.derivedSelect(subst(tp.prefix, from, to, theMap))
17
17
case _ : ThisType =>
18
18
tp
@@ -26,7 +26,7 @@ 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.prefix `eq` NoPrefix ) ) tp
29
+ if (tp.prefix `eq` NoPrefix ) tp
30
30
else tp.derivedSelect(subst1(tp.prefix, from, to, theMap))
31
31
case _ : ThisType | _ : BoundType =>
32
32
tp
@@ -42,7 +42,7 @@ 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.prefix `eq` NoPrefix ) ) tp
45
+ if (tp.prefix `eq` NoPrefix ) tp
46
46
else tp.derivedSelect(subst2(tp.prefix, from1, to1, from2, to2, theMap))
47
47
case _ : ThisType | _ : BoundType =>
48
48
tp
@@ -63,7 +63,7 @@ trait Substituters { this: Context =>
63
63
fs = fs.tail
64
64
ts = ts.tail
65
65
}
66
- if (sym.isStatic && ! existsStatic(from) || ( tp.prefix `eq` NoPrefix ) ) tp
66
+ if (tp.prefix `eq` NoPrefix ) tp
67
67
else tp.derivedSelect(subst(tp.prefix, from, to, theMap))
68
68
case _ : ThisType | _ : BoundType =>
69
69
tp
@@ -85,7 +85,7 @@ trait Substituters { this: Context =>
85
85
fs = fs.tail
86
86
ts = ts.tail
87
87
}
88
- if (sym.isStatic && ! existsStatic(from) || ( tp.prefix `eq` NoPrefix ) ) tp
88
+ if (tp.prefix `eq` NoPrefix ) tp
89
89
else tp.derivedSelect(substSym(tp.prefix, from, to, theMap))
90
90
case tp : ThisType =>
91
91
val sym = tp.cls
@@ -123,7 +123,7 @@ trait Substituters { this: Context =>
123
123
case tp @ RecThis (binder) =>
124
124
if (binder eq from) to else tp
125
125
case tp : NamedType =>
126
- if (tp.currentSymbol.isStatic || (tp. prefix `eq` NoPrefix ) ) tp
126
+ if (tp.prefix `eq` NoPrefix ) tp
127
127
else tp.derivedSelect(substRecThis(tp.prefix, from, to, theMap))
128
128
case _ : ThisType | _ : BoundType =>
129
129
tp
@@ -137,7 +137,7 @@ trait Substituters { this: Context =>
137
137
case tp : BoundType =>
138
138
if (tp == from) to else tp
139
139
case tp : NamedType =>
140
- if (tp.currentSymbol.isStatic || (tp. prefix `eq` NoPrefix ) ) tp
140
+ if (tp.prefix `eq` NoPrefix ) tp
141
141
else tp.derivedSelect(substParam(tp.prefix, from, to, theMap))
142
142
case _ : ThisType =>
143
143
tp
@@ -151,7 +151,7 @@ trait Substituters { this: Context =>
151
151
case tp : ParamRef =>
152
152
if (tp.binder == from) to(tp.paramNum) else tp
153
153
case tp : NamedType =>
154
- if (tp.currentSymbol.isStatic || (tp. prefix `eq` NoPrefix ) ) tp
154
+ if (tp.prefix `eq` NoPrefix ) tp
155
155
else tp.derivedSelect(substParams(tp.prefix, from, to, theMap))
156
156
case _ : ThisType =>
157
157
tp
@@ -160,11 +160,6 @@ trait Substituters { this: Context =>
160
160
.mapOver(tp)
161
161
}
162
162
163
- private def existsStatic (syms : List [Symbol ]): Boolean = syms match {
164
- case sym :: syms1 => sym.isStatic || existsStatic(syms1)
165
- case nil => false
166
- }
167
-
168
163
final class SubstBindingMap (from : BindingType , to : BindingType ) extends DeepTypeMap {
169
164
def apply (tp : Type ) = subst(tp, from, to, this )
170
165
}
0 commit comments