@@ -1002,19 +1002,19 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1002
1002
* @param resultType The expected result type of the application
1003
1003
*/
1004
1004
def isApplicable (methRef : TermRef , targs : List [Type ], args : List [Tree ], resultType : Type )(implicit ctx : Context ): Boolean =
1005
- ctx.typerState. test(new ApplicableToTrees (methRef, targs, args, resultType).success)
1005
+ ctx.test(implicit ctx => new ApplicableToTrees (methRef, targs, args, resultType).success)
1006
1006
1007
1007
/** Is given method reference applicable to type arguments `targs` and argument trees `args` without inferring views?
1008
1008
* @param resultType The expected result type of the application
1009
1009
*/
1010
1010
def isDirectlyApplicable (methRef : TermRef , targs : List [Type ], args : List [Tree ], resultType : Type )(implicit ctx : Context ): Boolean =
1011
- ctx.typerState. test(new ApplicableToTreesDirectly (methRef, targs, args, resultType).success)
1011
+ ctx.test(implicit ctx => new ApplicableToTreesDirectly (methRef, targs, args, resultType).success)
1012
1012
1013
1013
/** Is given method reference applicable to argument types `args`?
1014
1014
* @param resultType The expected result type of the application
1015
1015
*/
1016
1016
def isApplicable (methRef : TermRef , args : List [Type ], resultType : Type )(implicit ctx : Context ): Boolean =
1017
- ctx.typerState. test(new ApplicableToTypes (methRef, args, resultType).success)
1017
+ ctx.test(implicit ctx => new ApplicableToTypes (methRef, args, resultType).success)
1018
1018
1019
1019
/** Is given type applicable to type arguments `targs` and argument trees `args`,
1020
1020
* possibly after inserting an `apply`?
@@ -1119,7 +1119,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1119
1119
case tp2 : MethodType => true // (3a)
1120
1120
case tp2 : PolyType if tp2.resultType.isInstanceOf [MethodType ] => true // (3a)
1121
1121
case tp2 : PolyType => // (3b)
1122
- ctx.typerState. test(isAsSpecificValueType(tp1, constrained(tp2).resultType))
1122
+ ctx.test(implicit ctx => isAsSpecificValueType(tp1, constrained(tp2).resultType))
1123
1123
case _ => // (3b)
1124
1124
isAsSpecificValueType(tp1, tp2)
1125
1125
}
@@ -1271,9 +1271,9 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1271
1271
* do they prune much, on average.
1272
1272
*/
1273
1273
def adaptByResult (chosen : TermRef ) = pt match {
1274
- case pt : FunProto if ! ctx.typerState. test(resultConforms(chosen, pt.resultType)) =>
1274
+ case pt : FunProto if ! ctx.test(implicit ctx => resultConforms(chosen, pt.resultType)) =>
1275
1275
val conformingAlts = alts.filter(alt =>
1276
- (alt ne chosen) && ctx.typerState. test(resultConforms(alt, pt.resultType)))
1276
+ (alt ne chosen) && ctx.test(implicit ctx => resultConforms(alt, pt.resultType)))
1277
1277
conformingAlts match {
1278
1278
case Nil => chosen
1279
1279
case alt2 :: Nil => alt2
0 commit comments