@@ -3367,12 +3367,13 @@ trait Typers extends Modes with Adaptations with Tags {
3367
3367
// println(util.Position.formatMessage(uncheckedPattern.pos, "made unchecked type test into a checked one", true))
3368
3368
3369
3369
val args = List (uncheckedPattern)
3370
+ val app = atPos(uncheckedPattern.pos)(Apply (classTagExtractor, args))
3370
3371
// must call doTypedUnapply directly, as otherwise we get undesirable rewrites
3371
3372
// and re-typechecks of the target of the unapply call in PATTERNmode,
3372
3373
// this breaks down when the classTagExtractor (which defineds the unapply member) is not a simple reference to an object,
3373
3374
// 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
+ }
3376
3377
3377
3378
// if there's a ClassTag that allows us to turn the unchecked type test for `pt` into a checked type test
3378
3379
// return the corresponding extractor (an instance of ClassTag[`pt`])
@@ -4517,12 +4518,11 @@ trait Typers extends Modes with Adaptations with Tags {
4517
4518
// [Eugene] no more MaxArrayDims. ClassTags are flexible enough to allow creation of arrays of arbitrary dimensionality (w.r.t JVM restrictions)
4518
4519
val Some ((level, componentType)) = erasure.GenericArray .unapply(tpt.tpe)
4519
4520
val tagType = List .iterate(componentType, level)(tpe => appliedType(ArrayClass .toTypeConstructor, List (tpe))).last
4520
- val newArrayApp = atPos(tree.pos) {
4521
+ atPos(tree.pos) {
4521
4522
val tag = resolveClassTag(tree.pos, tagType)
4522
4523
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) )
4524
4525
}
4525
- typed(newArrayApp, mode, pt)
4526
4526
case Apply (Select (fun, nme.apply), _) if treeInfo.isSuperConstrCall(fun) => // SI-5696
4527
4527
TooManyArgumentListsForConstructor (tree)
4528
4528
case tree1 =>
0 commit comments