@@ -993,19 +993,19 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
993
993
* @param resultType The expected result type of the application
994
994
*/
995
995
def isApplicable (methRef : TermRef , targs : List [Type ], args : List [Tree ], resultType : Type )(implicit ctx : Context ): Boolean =
996
- ctx.typerState. test(new ApplicableToTrees (methRef, targs, args, resultType).success)
996
+ ctx.test(implicit ctx => new ApplicableToTrees (methRef, targs, args, resultType).success)
997
997
998
998
/** Is given method reference applicable to type arguments `targs` and argument trees `args` without inferring views?
999
999
* @param resultType The expected result type of the application
1000
1000
*/
1001
1001
def isDirectlyApplicable (methRef : TermRef , targs : List [Type ], args : List [Tree ], resultType : Type )(implicit ctx : Context ): Boolean =
1002
- ctx.typerState. test(new ApplicableToTreesDirectly (methRef, targs, args, resultType).success)
1002
+ ctx.test(implicit ctx => new ApplicableToTreesDirectly (methRef, targs, args, resultType).success)
1003
1003
1004
1004
/** Is given method reference applicable to argument types `args`?
1005
1005
* @param resultType The expected result type of the application
1006
1006
*/
1007
1007
def isApplicable (methRef : TermRef , args : List [Type ], resultType : Type )(implicit ctx : Context ): Boolean =
1008
- ctx.typerState. test(new ApplicableToTypes (methRef, args, resultType).success)
1008
+ ctx.test(implicit ctx => new ApplicableToTypes (methRef, args, resultType).success)
1009
1009
1010
1010
/** Is given type applicable to type arguments `targs` and argument trees `args`,
1011
1011
* possibly after inserting an `apply`?
@@ -1110,7 +1110,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1110
1110
case tp2 : MethodType => true // (3a)
1111
1111
case tp2 : PolyType if tp2.resultType.isInstanceOf [MethodType ] => true // (3a)
1112
1112
case tp2 : PolyType => // (3b)
1113
- ctx.typerState. test(isAsSpecificValueType(tp1, constrained(tp2).resultType))
1113
+ ctx.test(implicit ctx => isAsSpecificValueType(tp1, constrained(tp2).resultType))
1114
1114
case _ => // (3b)
1115
1115
isAsSpecificValueType(tp1, tp2)
1116
1116
}
@@ -1262,9 +1262,9 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1262
1262
* do they prune much, on average.
1263
1263
*/
1264
1264
def adaptByResult (chosen : TermRef ) = pt match {
1265
- case pt : FunProto if ! ctx.typerState. test(resultConforms(chosen, pt.resultType)) =>
1265
+ case pt : FunProto if ! ctx.test(implicit ctx => resultConforms(chosen, pt.resultType)) =>
1266
1266
val conformingAlts = alts.filter(alt =>
1267
- (alt ne chosen) && ctx.typerState. test(resultConforms(alt, pt.resultType)))
1267
+ (alt ne chosen) && ctx.test(implicit ctx => resultConforms(alt, pt.resultType)))
1268
1268
conformingAlts match {
1269
1269
case Nil => chosen
1270
1270
case alt2 :: Nil => alt2
0 commit comments