aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/Main.scala1
-rw-r--r--src/dotty/tools/dotc/ast/tpd.scala14
-rw-r--r--test/dotc/tests.scala5
3 files changed, 15 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/Main.scala b/src/dotty/tools/dotc/Main.scala
index 217bb3f65..746a9cb13 100644
--- a/src/dotty/tools/dotc/Main.scala
+++ b/src/dotty/tools/dotc/Main.scala
@@ -14,6 +14,7 @@ import reporting.Reporter
* - review isSubType
* - have a second look at normalization (leave at method types if pt is method type?)
* - fix problem with duplicate companion objects for classes with default parameters in constructors
+ * - Check usages of isAliasType and replace where possible by looking at the info.
*/
object Main extends Driver {
diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala
index b369b4e37..04fe41b65 100644
--- a/src/dotty/tools/dotc/ast/tpd.scala
+++ b/src/dotty/tools/dotc/ast/tpd.scala
@@ -6,6 +6,7 @@ import core._
import util.Positions._, Types._, Contexts._, Constants._, Names._, Flags._
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._
import CheckTrees._, Denotations._
+import config.Printers._
object tpd extends Trees.Instance[Type] with TypedTreeInfo {
@@ -102,11 +103,18 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def apply(tp: Type) = tp match {
case tp: TermRef if toAvoid(tp.symbol) && variance > 0 =>
apply(tp.info)
- case tp @ TypeRef(pre: TermRef, _) if tp.symbol.isAliasType && toAvoid(pre.symbol) =>
- apply(tp.info.bounds.hi)
+ case tp @ TypeRef(pre: TermRef, _) if toAvoid(pre.symbol) =>
+ tp.info match {
+ case TypeAlias(ref) => apply(ref)
+ case _ => mapOver(tp)
+ }
case tp @ RefinedType(parent, _) =>
val tp1 @ RefinedType(parent1, _) = mapOver(tp)
- if (tp1.refinedInfo existsPart toAvoid) parent1 else tp1
+ if (tp1.refinedInfo existsPart toAvoid) {
+ typr.println(s"dropping refinement from $tp1")
+ parent1
+ }
+ else tp1
case _ =>
mapOver(tp)
}
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala
index c6986431d..77cfdd39e 100644
--- a/test/dotc/tests.scala
+++ b/test/dotc/tests.scala
@@ -63,8 +63,9 @@ class tests extends CompilerTest {
@Test def dotc15 = compileFile(dotcDir + "tools/dotc/core/", "Signature")
@Test def dotc16 = compileFile(dotcDir + "tools/dotc/core/", "StdNames")
@Test def dotc17 = compileFile(dotcDir + "tools/dotc/core/", "Substituters")
-// @Test def dotc18 = compileFile(dotcDir + "tools/dotc/core/", "SymbolLoaders")
-// @Test def dotc19 = compileFile(dotcDir + "tools/dotc/core/", "Symbols")
+ @Test def dotc18 = compileFile(dotcDir + "tools/dotc/core/", "SymbolLoaders")
+ @Test def dotc19 = compileFile(dotcDir + "tools/dotc/core/", "Symbols")
+ @Test def dotc20 = compileFile(dotcDir + "tools/dotc/core/", "SymDenotations")