aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-14 17:32:16 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-14 17:32:16 +0100
commit01db9a68e5e68f08c8236c23c905009789d51587 (patch)
tree3e45103b0d36505d6f86f3024e56780e840c156b /src/dotty/tools/dotc/typer/Applications.scala
parentd65587ae74cfe2dc7601f57e163b7e22bf89582a (diff)
downloaddotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.gz
dotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.bz2
dotty-01db9a68e5e68f08c8236c23c905009789d51587.zip
Fixed several deep problems in handling of types and symbols.
1. We forgot to mark declaration symbols Deferred. 2. Types with NoPrefix and the same name got identified. Fixed by adding a new category WithNoPrefix to named types, and changing the way named types get generated. 3. Self types lacked parameters. (Question: Do we need to also track type members?) 4. Printers caused cyclic reference errors. Now some print operations are more careful with forcing. 5. Namedparts accumulator has to be more careful with ThisTypes. Because self types now contain parameters, which might lead back to this, we only add the class name (or the source module, if it's a module class). 6. toBounds in TypeApplications needs to use Co/Contra aliases for expanded name parameters, not just local ones.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 64f44ee5e..dba95c689 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -621,10 +621,13 @@ trait Applications extends Compatibility { self: Typer =>
}
println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}")
unapplyArgType
- } else errorType(
- i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt",
- tree.pos)
-
+ } else {
+ // println("Neither sub nor super")
+ // println(TypeComparer.explained(implicit ctx => unapplyArgType <:< wpt))
+ errorType(
+ i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt",
+ tree.pos)
+ }
var argTypes = unapplyArgs(mt.resultType)
val bunchedArgs = argTypes match {
case argType :: Nil if argType.isRepeatedParam => untpd.SeqLiteral(args) :: Nil
@@ -666,7 +669,7 @@ trait Applications extends Compatibility { self: Typer =>
isApplicable(methRef, args, resultType)
case _ =>
val app = tp.member(nme.apply)
- app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply).withDenot(d), args, resultType))
+ app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply, d), args, resultType))
}
/** In a set of overloaded applicable alternatives, is `alt1` at least as good as