@@ -3367,12 +3367,13 @@ trait Typers extends Modes with Adaptations with Tags {
33673367 // println(util.Position.formatMessage(uncheckedPattern.pos, "made unchecked type test into a checked one", true))
33683368
33693369 val args = List (uncheckedPattern)
3370+ val app = atPos(uncheckedPattern.pos)(Apply (classTagExtractor, args))
33703371 // must call doTypedUnapply directly, as otherwise we get undesirable rewrites
33713372 // and re-typechecks of the target of the unapply call in PATTERNmode,
33723373 // this breaks down when the classTagExtractor (which defineds the unapply member) is not a simple reference to an object,
33733374 // but an arbitrary tree as is the case here
3374- doTypedUnapply(Apply (classTagExtractor, args) , classTagExtractor, classTagExtractor, args, PATTERNmode , pt)
3375- }
3375+ doTypedUnapply(app , classTagExtractor, classTagExtractor, args, PATTERNmode , pt)
3376+ }
33763377
33773378 // if there's a ClassTag that allows us to turn the unchecked type test for `pt` into a checked type test
33783379 // return the corresponding extractor (an instance of ClassTag[`pt`])
@@ -4517,12 +4518,11 @@ trait Typers extends Modes with Adaptations with Tags {
45174518 // [Eugene] no more MaxArrayDims. ClassTags are flexible enough to allow creation of arrays of arbitrary dimensionality (w.r.t JVM restrictions)
45184519 val Some ((level, componentType)) = erasure.GenericArray .unapply(tpt.tpe)
45194520 val tagType = List .iterate(componentType, level)(tpe => appliedType(ArrayClass .toTypeConstructor, List (tpe))).last
4520- val newArrayApp = atPos(tree.pos) {
4521+ atPos(tree.pos) {
45214522 val tag = resolveClassTag(tree.pos, tagType)
45224523 if (tag.isEmpty) MissingClassTagError (tree, tagType)
4523- else new ApplyToImplicitArgs (Select (tag, nme.newArray), args)
4524+ else typed( new ApplyToImplicitArgs (Select (tag, nme.newArray), args) )
45244525 }
4525- typed(newArrayApp, mode, pt)
45264526 case Apply (Select (fun, nme.apply), _) if treeInfo.isSuperConstrCall(fun) => // SI-5696
45274527 TooManyArgumentListsForConstructor (tree)
45284528 case tree1 =>
0 commit comments