diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-29 11:30:05 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-29 11:30:05 +0200 |
commit | 9a49deff8a1905b9dc111e79638541ea5ba927c9 (patch) | |
tree | 6fd3340071ec9c09527fe7635242bc77cda7a167 /src/dotty/tools/dotc/core/Substituters.scala | |
parent | 8b9bdfe5f0c8c084b2db90ddcc0b5bbc25347034 (diff) | |
download | dotty-9a49deff8a1905b9dc111e79638541ea5ba927c9.tar.gz dotty-9a49deff8a1905b9dc111e79638541ea5ba927c9.tar.bz2 dotty-9a49deff8a1905b9dc111e79638541ea5ba927c9.zip |
Shorten "if denotation is current the symbol" to "currentSymbol".
And make its usage more systematic on all substitutions where it makes sense.
Diffstat (limited to 'src/dotty/tools/dotc/core/Substituters.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Substituters.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Substituters.scala b/src/dotty/tools/dotc/core/Substituters.scala index c67d352a4..a7977dc2b 100644 --- a/src/dotty/tools/dotc/core/Substituters.scala +++ b/src/dotty/tools/dotc/core/Substituters.scala @@ -12,7 +12,7 @@ trait Substituters { this: Context => case tp: BoundType => if (tp.binder eq from) tp.copyBoundType(to.asInstanceOf[tp.BT]) else tp case tp: NamedType => - if (tp.denotationIsCurrent && tp.symbol.isStatic) tp + if (tp.currentSymbol.isStatic) tp else tp.derivedSelect(subst(tp.prefix, from, to, theMap)) case _: ThisType | NoPrefix => tp @@ -166,7 +166,7 @@ trait Substituters { this: Context => case tp: ThisType => if (tp.cls eq from) to else tp case tp: NamedType => - if (tp.symbol.isStaticOwner) tp + if (tp.currentSymbol.isStaticOwner) tp else tp.derivedSelect(substThis(tp.prefix, from, to, theMap)) case _: BoundType | NoPrefix => tp @@ -184,7 +184,7 @@ trait Substituters { this: Context => case tp @ RefinedThis(rt) => if (rt eq from) to else tp case tp: NamedType => - if (tp.denotationIsCurrent && tp.symbol.isStatic) tp + if (tp.currentSymbol.isStatic) tp else tp.derivedSelect(substThis(tp.prefix, from, to, theMap)) case _: ThisType | _: BoundType | NoPrefix => tp @@ -202,7 +202,7 @@ trait Substituters { this: Context => case tp: BoundType => if (tp == from) to else tp case tp: NamedType => - if (tp.symbol.isStatic) tp + if (tp.currentSymbol.isStatic) tp else tp.derivedSelect(substParam(tp.prefix, from, to, theMap)) case _: ThisType | NoPrefix => tp @@ -220,7 +220,7 @@ trait Substituters { this: Context => case tp: ParamType => if (tp.binder == from) to(tp.paramNum) else tp case tp: NamedType => - if (tp.symbol.isStatic) tp + if (tp.currentSymbol.isStatic) tp else tp.derivedSelect(substParams(tp.prefix, from, to, theMap)) case _: ThisType | NoPrefix | _: RefinedThis => tp |