diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-04 18:21:11 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:00 +0200 |
commit | 939d9da26ee5992c17cd1fae0a501ed66a49fb95 (patch) | |
tree | 7efeb8e2cc3f4fdcfcbbf8b06051b3b4fc55240b /src/dotty/tools/dotc/core/TypeOps.scala | |
parent | ae1f248ff407b231455a43ecbaf4751c0bb2bbaa (diff) | |
download | dotty-939d9da26ee5992c17cd1fae0a501ed66a49fb95.tar.gz dotty-939d9da26ee5992c17cd1fae0a501ed66a49fb95.tar.bz2 dotty-939d9da26ee5992c17cd1fae0a501ed66a49fb95.zip |
Add a second betaReduce
The new one only reduces straight applications of type lambdas with
definite arguments. It is called very early on appliedTo, and derivedRefinedType.
The old one, now renamed to normalizeHkApply also handles wildcard arguments
and can garbage collect general unneeded hk-refinements. It is called later, at various
places.
TODO: See what functionality of normalizeHkApply should go into betaReduce instead.
Maybe we can even drop normalizeHkApply? However: need to be careful to maintain aliases
for hk type inference.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeOps.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index c6a18f305..ca49d3d3c 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -158,7 +158,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object. tp case tp: RefinedType => tp.derivedRefinedType(simplify(tp.parent, theMap), tp.refinedName, simplify(tp.refinedInfo, theMap)) - .BetaReduce + .normalizeHkApply case tp: TypeAlias => tp.derivedTypeAlias(simplify(tp.alias, theMap)) case AndType(l, r) => @@ -384,7 +384,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object. var formals: SimpleMap[TypeName, Symbol] = SimpleMap.Empty // A map of all formal parent parameter // Strip all refinements from parent type, populating `refinements` and `formals` maps. - def normalizeToRef(tp: Type): TypeRef = tp.dealias.BetaReduce match { + def normalizeToRef(tp: Type): TypeRef = tp.dealias.normalizeHkApply match { case tp: TypeRef => tp case tp @ RefinedType(tp1, name: TypeName, rinfo) => |