From 15317555c94f613f266d7b0fb0a75b0b6ed2da6d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 19 Mar 2017 12:42:55 +0100 Subject: 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. --- compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/src/dotty/tools/dotc/core/TypeErasure.scala') 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 => -- cgit v1.2.3