aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
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)
}