summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-03-09 17:20:47 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-03-09 23:35:17 +0100
commit745c36a3289d9d5a9078ee07dc4f7187e1cb2fc3 (patch)
tree674dad8d61082cf6d88e015c8f46784be77ff11f /src
parent2ff7650fb9f337dd123449e6cbcefc521cac8556 (diff)
downloadscala-745c36a3289d9d5a9078ee07dc4f7187e1cb2fc3.tar.gz
scala-745c36a3289d9d5a9078ee07dc4f7187e1cb2fc3.tar.bz2
scala-745c36a3289d9d5a9078ee07dc4f7187e1cb2fc3.zip
SI-7328 Bail out of names/defaults if args are error typed
To avoid a crasher later on with a null type inside a sequence argument.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index 2340c78f8c..d284be13bc 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -329,11 +329,10 @@ trait NamesDefaults { self: Analyzer =>
// type the application without names; put the arguments in definition-site order
val typedApp = doTypedApply(tree, funOnly, reorderArgs(namelessArgs, argPos), mode, pt)
- if (typedApp.isErrorTyped) tree
- else typedApp match {
+ typedApp match {
// Extract the typed arguments, restore the call-site evaluation order (using
// ValDef's in the block), change the arguments to these local values.
- case Apply(expr, typedArgs) =>
+ case Apply(expr, typedArgs) if !(typedApp :: typedArgs).exists(_.isErrorTyped) => // bail out with erroneous args, see SI-7238
// typedArgs: definition-site order
val formals = formalTypes(expr.tpe.paramTypes, typedArgs.length, removeByName = false, removeRepeated = false)
// valDefs: call-site order
@@ -361,6 +360,7 @@ trait NamesDefaults { self: Analyzer =>
context.namedApplyBlockInfo =
Some((block, NamedApplyInfo(qual, targs, vargss :+ refArgs, blockTyper)))
block
+ case _ => tree
}
}