@@ -43,13 +43,13 @@ trait Holes { self: Quasiquotes =>
4343 tpe <:< NothingClass .tpe || tpe <:< NullClass .tpe
4444 private def extractIterableTParam (tpe : Type ) =
4545 IterableTParam .asSeenFrom(tpe, IterableClass )
46- private def stripIterable (tpe : Type , limit : Option [ Rank ] = None ): (Rank , Type ) =
47- if (limit.map { _ == NoDot }.getOrElse { false } ) (NoDot , tpe)
46+ private def stripIterable (tpe : Type , limit : Rank = DotDotDot ): (Rank , Type ) =
47+ if (limit == NoDot ) (NoDot , tpe)
4848 else if (tpe != null && ! isIterableType(tpe)) (NoDot , tpe)
4949 else if (isBottomType(tpe)) (NoDot , tpe)
5050 else {
5151 val targ = extractIterableTParam(tpe)
52- val (rank, innerTpe) = stripIterable(targ, limit.map { _. pred } )
52+ val (rank, innerTpe) = stripIterable(targ, limit.pred)
5353 (rank.succ, innerTpe)
5454 }
5555 private def iterableTypeFromRank (n : Rank , tpe : Type ): Type = {
@@ -76,7 +76,7 @@ trait Holes { self: Quasiquotes =>
7676
7777 class ApplyHole (annotatedRank : Rank , unquotee : Tree ) extends Hole {
7878 val (strippedTpe, tpe): (Type , Type ) = {
79- val (strippedRank, strippedTpe) = stripIterable(unquotee.tpe, limit = Some ( annotatedRank) )
79+ val (strippedRank, strippedTpe) = stripIterable(unquotee.tpe, limit = annotatedRank)
8080 if (isBottomType(strippedTpe)) cantSplice()
8181 else if (isNativeType(strippedTpe)) {
8282 if (strippedRank != NoDot && ! (strippedTpe <:< treeType) && ! isLiftableType(strippedTpe)) cantSplice()
@@ -193,7 +193,7 @@ trait Holes { self: Quasiquotes =>
193193 val (iterableRank, _) = stripIterable(tpe)
194194 if (iterableRank.value < rank.value)
195195 c.abort(pat.pos, s " Can't extract $tpe with $rank, consider using $iterableRank" )
196- val (_, strippedTpe) = stripIterable(tpe, limit = Some ( rank) )
196+ val (_, strippedTpe) = stripIterable(tpe, limit = rank)
197197 if (strippedTpe <:< treeType) treeNoUnlift
198198 else
199199 unlifters.spawn(strippedTpe, rank).map {
0 commit comments