aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-29 19:54:09 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:02 +0200
commit830b72432fc02b86e798da24b084264881cbc392 (patch)
tree407bc9fe527ee403621269bf2ee6c6fd8624d671 /src
parentf1bf78bf8ceb17bfe0b9dc57a6e6f03a9b59065f (diff)
downloaddotty-830b72432fc02b86e798da24b084264881cbc392.tar.gz
dotty-830b72432fc02b86e798da24b084264881cbc392.tar.bz2
dotty-830b72432fc02b86e798da24b084264881cbc392.zip
Change tests
- compileMixed failed because there was a cycle between immutable.Seq (compiled) and parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme did not go into the cycle because it did not force an unrelated type. I believe with enough tweaking we would also hva egotten a cycle in the old hk scheme. The test is "fixed" by adding parallel.ParSeq to the files to compile. - Disable named parameter tests Those tests do not work yet with the revised hk scheme. Before trying to fix this, we should first decide what parts of named parameters should be kept.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala15
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreePickler.scala4
-rw-r--r--src/dotty/tools/dotc/sbt/ExtractDependencies.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala4
4 files changed, 22 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index dfe94de44..5f28d07eb 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -657,6 +657,21 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
if (inOrder) unifyWith(other)
else testLifted(other, app, hkTypeParams, unifyWith)
case _ =>
+ // why only handle the case where one of the sides is a typevar or poly param?
+ // If the LHS is a hk application, then the normal logic already handles
+ // all other cases. Indeed, say you have
+ //
+ // type C[T] <: List[T]
+ //
+ // where C is an abstract type. Then to verify `C[Int] <: List[Int]`,
+ // use compareRefinedslow to get `C <: List` and verify that
+ //
+ // C#List$T = C$$hk0 = Int
+ //
+ // If the RHS is a hk application, we can also go through
+ // the normal logic because lower bounds are not parameterized.
+ // If were to re-introduce parameterized lower bounds of hk types
+ // we'd have to add some logic to handle them here.
false
}
}
diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala
index 9f703b5af..9be5c8bcf 100644
--- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala
@@ -76,6 +76,10 @@ class TreePickler(pickler: TastyPickler) {
case Some(label) =>
if (label != NoAddr) writeRef(label) else pickleForwardSymRef(sym)
case None =>
+ // See pos/t1957.scala for an example where this can happen.
+ // I believe it's a bug in typer: the type of an implicit argument refers
+ // to a closure parameter outside the closure itself. TODO: track this down, so that we
+ // can eliminate this case.
ctx.log(i"pickling reference to as yet undefined $sym in ${sym.owner}", sym.pos)
pickleForwardSymRef(sym)
}
diff --git a/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
index 181d6a2d7..1f19a1058 100644
--- a/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
+++ b/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
@@ -164,7 +164,7 @@ private class ExtractDependenciesCollector(implicit val ctx: Context) extends tp
sym.isEffectiveRoot ||
sym.isAnonymousFunction ||
sym.isAnonymousClass ||
- sym.isLambdaTrait
+ sym.isLambdaTraitOBS
private def addInheritanceDependency(sym: Symbol): Unit =
_topLevelInheritanceDependencies += sym.topLevelClass
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index e21a08fb8..1b02f7e70 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -284,12 +284,12 @@ trait ImplicitRunInfo { self: RunInfo =>
override implicit protected val ctx: Context = liftingCtx
override def stopAtStatic = true
def apply(tp: Type) = tp match {
- case tp: TypeRef if tp.symbol.isLambdaTrait =>
+ case tp: TypeRef if tp.symbol.isLambdaTraitOBS =>
defn.AnyType
case tp: TypeRef if tp.symbol.isAbstractOrAliasType =>
val pre = tp.prefix
def joinClass(tp: Type, cls: ClassSymbol) =
- if (cls.isLambdaTrait) tp
+ if (cls.isLambdaTraitOBS) tp
else AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner))
val lead = if (tp.prefix eq NoPrefix) defn.AnyType else apply(tp.prefix)
(lead /: tp.classSymbols)(joinClass)