aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-16 21:22:59 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-16 21:22:59 +0100
commit87628400a73f9ed033fc2a29e494407234ae6f79 (patch)
treec95bbf942d355604351af417195157b4dc749720 /src/dotty/tools/dotc/typer/Applications.scala
parent2ede22228c09ca7c2f4ae190ec2086787238ed0a (diff)
downloaddotty-87628400a73f9ed033fc2a29e494407234ae6f79.tar.gz
dotty-87628400a73f9ed033fc2a29e494407234ae6f79.tar.bz2
dotty-87628400a73f9ed033fc2a29e494407234ae6f79.zip
Eliminating StateFul
Was only needed as a parameter to a continuation, so it seemed easier to just pass the components directly.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 5912e5e7b..857ff31ff 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -458,7 +458,7 @@ trait Applications extends Compatibility { self: Typer =>
else new ApplyToUntyped(tree, fun1, funRef, proto, pt)
val result = app.result
ConstFold(result) orElse result
- } { failed => fun1 match {
+ } { (failedVal, failedState) => fun1 match {
case Select(qual, name) =>
// try with prototype `[].name(args)`, this might succeed by inserting an
// implicit conversion around []. (an example is Int + BigInt).
@@ -471,10 +471,13 @@ trait Applications extends Compatibility { self: Typer =>
cpy.Select(fun1, untpd.TypedSplice(qual1), name),
proto.typedArgs map untpd.TypedSplice),
pt)
- } { _ => failed.commit()
+ } { (_, _) =>
+ failedState.commit()
+ failedVal
}
case _ =>
- failed.commit()
+ failedState.commit()
+ failedVal
}
}
case _ =>
@@ -505,11 +508,12 @@ trait Applications extends Compatibility { self: Typer =>
if (untpd.isOpAssign(tree))
tryEither {
implicit ctx => realApply
- } { failed =>
+ } { (failedVal, failedState) =>
tryEither {
implicit ctx => typedOpAssign
- } { _ =>
- failed.commit()
+ } { (_, _) =>
+ failedState.commit()
+ failedVal
}
}
else realApply
@@ -546,11 +550,11 @@ trait Applications extends Compatibility { self: Typer =>
tryEither {
implicit ctx => typedExpr(untpd.Select(qual, nme.unapply), unappProto)
} {
- s =>
+ (sel, _) =>
tryEither {
implicit ctx => typedExpr(untpd.Select(qual, nme.unapplySeq), unappProto) // for backwards compatibility; will be dropped
} {
- _ => notAnExtractor(s.value)
+ (_, _) => notAnExtractor(sel)
}
}
}