aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-03 16:07:53 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-03 16:19:28 +0100
commit81fa82742df63e498926aaf427cd0a49960818a3 (patch)
treeb3651d1a96e9174294376be2a9314966d95df0e4 /src/dotty/tools/dotc/typer/Typer.scala
parent6ddd2c60a77024b82372f111c9cc2979cbde0ee4 (diff)
downloaddotty-81fa82742df63e498926aaf427cd0a49960818a3.tar.gz
dotty-81fa82742df63e498926aaf427cd0a49960818a3.tar.bz2
dotty-81fa82742df63e498926aaf427cd0a49960818a3.zip
Generalizing the idea of lossless dealiasings to all accumulators and typemaps.
This was needed because otherwise we'd get fake dependent method types of the form x.A where x is a method parameter of class C and A is C's type parameter.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index eec005bc5..14345a627 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -508,10 +508,9 @@ class Typer extends Namer with Applications with Implicits {
val env1 = tree.env mapconserve (typed(_))
val meth1 = typedUnadapted(tree.meth)
val ownType = meth1.tpe.widen match {
- case mt: MethodType if !mt.isDependent =>
- mt.toFunctionType
case mt: MethodType =>
- errorType(i"internal error: cannot turn dependent method type $mt into closure", tree.pos)
+ if (!mt.isDependent) mt.toFunctionType
+ else errorType(i"internal error: cannot turn dependent method type $mt into closure", tree.pos)
case tp =>
errorType(i"internal error: closing over non-method $tp", tree.pos)
}