From 60fb657649d800c03e8335892cd82455e7e34235 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 1 Dec 2015 16:52:01 +0100 Subject: Compile scala.collection.Seq without double-binding error This commit fixes two issues which caused us to complete Seq too early and read it from the classpath instead of from the sources: - Evaluting RepeatedParamClass forced Seq, this is not necessary because the type of RepeatedParamClass is a LazyType - TypeErasure#sigName on a Scala type always forced Seq, even if the type is not a repeated param type. This fixes #980. --- src/dotty/tools/dotc/core/TypeErasure.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/TypeErasure.scala') diff --git a/src/dotty/tools/dotc/core/TypeErasure.scala b/src/dotty/tools/dotc/core/TypeErasure.scala index 7cca37911..108d862a9 100644 --- a/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/src/dotty/tools/dotc/core/TypeErasure.scala @@ -126,9 +126,11 @@ object TypeErasure { erasureFn(isJava = false, semiEraseVCs = true, isConstructor = false, wildcardOK = false)(tp)(erasureCtx) def sigName(tp: Type, isJava: Boolean)(implicit ctx: Context): TypeName = { - val seqClass = if (isJava) defn.ArrayClass else defn.SeqClass val normTp = - if (tp.isRepeatedParam) tp.translateParameterized(defn.RepeatedParamClass, seqClass) + if (tp.isRepeatedParam) { + val seqClass = if (isJava) defn.ArrayClass else defn.SeqClass + tp.translateParameterized(defn.RepeatedParamClass, seqClass) + } else tp val erase = erasureFn(isJava, semiEraseVCs = false, isConstructor = false, wildcardOK = true) erase.sigName(normTp)(erasureCtx) -- cgit v1.2.3