diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-19 12:42:55 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-06 13:15:29 +0200 |
commit | 15317555c94f613f266d7b0fb0a75b0b6ed2da6d (patch) | |
tree | 24066bc08e95b411d2ac5f0b54ec1382e3fa9451 /compiler/src | |
parent | f6c61f3976a2780ce42ea6cd814986b662570687 (diff) | |
download | dotty-15317555c94f613f266d7b0fb0a75b0b6ed2da6d.tar.gz dotty-15317555c94f613f266d7b0fb0a75b0b6ed2da6d.tar.bz2 dotty-15317555c94f613f266d7b0fb0a75b0b6ed2da6d.zip |
Make PolyType a ground type
It's too surprising to leave it as a type proxy. In all circumstances except
erasure, it is not true that a PolyType is somehow the same as its result type.
Diffstat (limited to 'compiler/src')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 4 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index 8ff0be9d7..f35752644 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala @@ -389,6 +389,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean case rt => tp.derivedLambdaType(tp.paramNames, formals, rt) } + case tp: PolyType => + this(tp.resultType) case tp @ ClassInfo(pre, cls, classParents, decls, _) => if (cls is Package) tp else { @@ -517,6 +519,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean if (inst.exists) sigName(inst) else tpnme.Uninstantiated case tp: TypeProxy => sigName(tp.underlying) + case tp: PolyType => + sigName(tp.resultType) case _: ErrorType | WildcardType => tpnme.WILDCARD case tp: WildcardType => diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index d0c7990f8..1855e3376 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2706,7 +2706,7 @@ object Types { */ class PolyType(val paramNames: List[TypeName])( paramInfosExp: PolyType => List[TypeBounds], resultTypeExp: PolyType => Type) - extends HKLambda with TypeLambda { + extends MethodOrPoly with TypeLambda { type This = PolyType def companion = PolyType |