Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SI-6685 fixes error handling in typedApply

When MissingClassTagError doesn't lead to an exception, but rather
silently sets an error, we need to bubble the resulting erroneous tree
up the responsibility chain instead of mindlessly typechecking this again.

This wasn't an issue before, because as far as I can guess the
aforementioned error setter was always throwing exceptions in the most
common usage scenarios (therefore the typecheck-again-fail-again
vicious loop wasn't triggered).
  • Loading branch information...
commit e6441f16e8c85b43537f227e8e1a5d27a867a0ea 1 parent 57b91c5
@xeno-by xeno-by authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/compiler/scala/tools/nsc/typechecker/Typers.scala
View
5 src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4516,12 +4516,11 @@ trait Typers extends Modes with Adaptations with Tags {
// [Eugene] no more MaxArrayDims. ClassTags are flexible enough to allow creation of arrays of arbitrary dimensionality (w.r.t JVM restrictions)
val Some((level, componentType)) = erasure.GenericArray.unapply(tpt.tpe)
val tagType = List.iterate(componentType, level)(tpe => appliedType(ArrayClass.toTypeConstructor, List(tpe))).last
- val newArrayApp = atPos(tree.pos) {
+ atPos(tree.pos) {
val tag = resolveClassTag(tree.pos, tagType)
if (tag.isEmpty) MissingClassTagError(tree, tagType)
- else new ApplyToImplicitArgs(Select(tag, nme.newArray), args)
+ else typed(new ApplyToImplicitArgs(Select(tag, nme.newArray), args))
}
- typed(newArrayApp, mode, pt)
case Apply(Select(fun, nme.apply), _) if treeInfo.isSuperConstrCall(fun) => //SI-5696
TooManyArgumentListsForConstructor(tree)
case tree1 =>
Please sign in to comment.
Something went wrong with that request. Please try again.