diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-03 16:07:53 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-03 16:19:28 +0100 |
commit | 81fa82742df63e498926aaf427cd0a49960818a3 (patch) | |
tree | b3651d1a96e9174294376be2a9314966d95df0e4 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 6ddd2c60a77024b82372f111c9cc2979cbde0ee4 (diff) | |
download | dotty-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.scala | 5 |
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) } |