From 3ba93487402d3210d96ef255cc10faaf960c89f3 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Sat, 27 Apr 2013 00:22:58 +0200 Subject: [PATCH] Do not normalize types in the api extraction phase. In summary this commit: * drops type normalization in api phase but keeps dealiasing * fixes #736 and marks corresponding test as passing I discussed type normalization with @adriaanm and according to him sbt shouldn't call that method. The purpose of this method to convert to a form that subtyping algorithm expects. Sbt doesn't need to call it and it's fairly expensive in some cases. Dropping type normalization also fixes #726 by not running into stale cache in Scala compiler problem described in SI-7361. --- compile/interface/src/main/scala/xsbt/API.scala | 8 ++++++-- .../abstract-type-override/{pending => test} | 0 2 files changed, 6 insertions(+), 2 deletions(-) rename sbt/src/sbt-test/source-dependencies/abstract-type-override/{pending => test} (100%) diff --git a/compile/interface/src/main/scala/xsbt/API.scala b/compile/interface/src/main/scala/xsbt/API.scala index e3e176a4e..b20219823 100644 --- a/compile/interface/src/main/scala/xsbt/API.scala +++ b/compile/interface/src/main/scala/xsbt/API.scala @@ -312,9 +312,13 @@ final class API(val global: CallbackGlobal) extends Compat private def processType(in: Symbol, t: Type): xsbti.api.Type = typeCache.getOrElseUpdate((in, t), makeType(in, t)) private def makeType(in: Symbol, t: Type): xsbti.api.Type = { - def dealias(t: Type) = t match { case TypeRef(_, sym, _) if sym.isAliasType => t.normalize; case _ => t } - dealias(t) match + val dealiased = t match { + case TypeRef(_, sym, _) if sym.isAliasType => t.dealias + case _ => t + } + + dealiased match { case NoPrefix => Constants.emptyType case ThisType(sym) => new xsbti.api.Singleton(thisPath(sym)) diff --git a/sbt/src/sbt-test/source-dependencies/abstract-type-override/pending b/sbt/src/sbt-test/source-dependencies/abstract-type-override/test similarity index 100% rename from sbt/src/sbt-test/source-dependencies/abstract-type-override/pending rename to sbt/src/sbt-test/source-dependencies/abstract-type-override/test