diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-19 11:50:13 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-21 18:42:50 +0100 |
commit | f699ba201bafccc66657a2765f280a226fcd9e55 (patch) | |
tree | f44f9f9295c781bf182e8eafd25dfda3f6e8c8f3 /src/dotty/tools/dotc/core/Substituters.scala | |
parent | 77fc4d0831dc7a7ddaa74677e2659cdea4a2f52f (diff) | |
download | dotty-f699ba201bafccc66657a2765f280a226fcd9e55.tar.gz dotty-f699ba201bafccc66657a2765f280a226fcd9e55.tar.bz2 dotty-f699ba201bafccc66657a2765f280a226fcd9e55.zip |
Avoid using TypeBounds in alias refinements.
The idea is to use the alias itself. This cuts down on # of typebounds created and makes operations on refined infos and applied types more direct.
Diffstat (limited to 'src/dotty/tools/dotc/core/Substituters.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Substituters.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/Substituters.scala b/src/dotty/tools/dotc/core/Substituters.scala index 944931698..2b4b8c167 100644 --- a/src/dotty/tools/dotc/core/Substituters.scala +++ b/src/dotty/tools/dotc/core/Substituters.scala @@ -17,7 +17,7 @@ trait Substituters { this: Context => case _: ThisType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(subst(tp.parent, from, to, map), tp.refinedName, subst(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(subst(tp.parent, from, to, map), tp.refinedName, subst(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstBindingMap(from, to)) .mapOver(tp) @@ -33,7 +33,7 @@ trait Substituters { this: Context => case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(subst1(tp.parent, from, to, map), tp.refinedName, subst1(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(subst1(tp.parent, from, to, map), tp.refinedName, subst1(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new Subst1Map(from, to)) .mapOver(tp) @@ -51,7 +51,7 @@ trait Substituters { this: Context => case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(subst2(tp.parent, from1, to1, from2, to2, map), tp.refinedName, subst2(tp.refinedInfo, from1, to1, from2, to2, map)) + tp.derivedRefinedType(subst2(tp.parent, from1, to1, from2, to2, map), tp.refinedName, subst2(tp.compactInfo, from1, to1, from2, to2, map)) case _ => (if (map != null) map else new Subst2Map(from1, to1, from2, to2)) .mapOver(tp) @@ -74,7 +74,7 @@ trait Substituters { this: Context => case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(subst(tp.parent, from, to, map), tp.refinedName, subst(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(subst(tp.parent, from, to, map), tp.refinedName, subst(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstMap(from, to)) .mapOver(tp) @@ -97,7 +97,7 @@ trait Substituters { this: Context => case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(substSym(tp.parent, from, to, map), tp.refinedName, substSym(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(substSym(tp.parent, from, to, map), tp.refinedName, substSym(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstSymMap(from, to)) .mapOver(tp) @@ -113,7 +113,7 @@ trait Substituters { this: Context => case _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(substThis(tp.parent, from, to, map), tp.refinedName, substThis(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(substThis(tp.parent, from, to, map), tp.refinedName, substThis(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstThisMap(from, to)) .mapOver(tp) @@ -129,7 +129,7 @@ trait Substituters { this: Context => case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(substThis(tp.parent, from, to, map), tp.refinedName, substThis(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(substThis(tp.parent, from, to, map), tp.refinedName, substThis(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstRefinedThisMap(from, to)) .mapOver(tp) @@ -145,7 +145,7 @@ trait Substituters { this: Context => case _: ThisType | NoPrefix => tp case tp: RefinedType => - tp.derivedRefinedType(substParam(tp.parent, from, to, map), tp.refinedName, substParam(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(substParam(tp.parent, from, to, map), tp.refinedName, substParam(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstParamMap(from, to)) .mapOver(tp) @@ -161,7 +161,7 @@ trait Substituters { this: Context => case _: ThisType | NoPrefix | _: RefinedThis => tp case tp: RefinedType => - tp.derivedRefinedType(substParams(tp.parent, from, to, map), tp.refinedName, substParams(tp.refinedInfo, from, to, map)) + tp.derivedRefinedType(substParams(tp.parent, from, to, map), tp.refinedName, substParams(tp.compactInfo, from, to, map)) case _ => (if (map != null) map else new SubstParamsMap(from, to)) .mapOver(tp) |