@@ -43,7 +43,6 @@ class Macros[C <: blackbox.Context](val c: C) {
43
43
def extractMethod (method : MethodSymbol ,
44
44
curCls : c.universe.Type ,
45
45
convertToResultType : c.Tree ,
46
- ctx : c.Tree ,
47
46
argReaders : Seq [c.Tree ],
48
47
annotDeserializeTypes : Seq [c.Tree ]): c.universe.Tree = {
49
48
val baseArgSym = TermName (c.freshName())
@@ -108,18 +107,18 @@ class Macros[C <: blackbox.Context](val c: C) {
108
107
109
108
val argSig =
110
109
q """
111
- cask.router.ArgSig[ $annotDeserializeType, $curCls, $docUnwrappedType, $ctx ](
110
+ cask.router.ArgSig[ $annotDeserializeType, $curCls, $docUnwrappedType, Any ](
112
111
${arg.name.toString},
113
112
${docUnwrappedType.toString},
114
113
$docTree,
115
114
$defaultOpt
116
- )( $argReader[ $docUnwrappedType])
115
+ )( $argReader[ $docUnwrappedType].asInstanceOf[cask.router.ArgReader[ $annotDeserializeType , $docUnwrappedType , Any]] )
117
116
"""
118
117
119
118
val reader = q """
120
119
cask.router.Runtime.makeReadCall(
121
120
$argValuesSymbol( $argListIndex),
122
- $ctxSymbol,
121
+ $ctxSymbol( $argListIndex ) ,
123
122
$default,
124
123
$argSigsSymbol( $argListIndex)( $i)
125
124
)
@@ -151,7 +150,7 @@ class Macros[C <: blackbox.Context](val c: C) {
151
150
for (argNameCast <- argNameCasts) methodCall = q " $methodCall(.. $argNameCast) "
152
151
153
152
val res = q """
154
- cask.router.EntryPoint[ $curCls, $ctx ](
153
+ cask.router.EntryPoint[ $curCls, Any ](
155
154
${method.name.toString},
156
155
${argSigs.toList},
157
156
${methodDoc match {
@@ -160,9 +159,9 @@ class Macros[C <: blackbox.Context](val c: C) {
160
159
}},
161
160
(
162
161
$baseArgSym: $curCls,
163
- $ctxSymbol: $ctx ,
162
+ $ctxSymbol: Seq[_] ,
164
163
$argValuesSymbol: Seq[Map[String, Any]],
165
- $argSigsSymbol: scala.Seq[scala.Seq[cask.router.ArgSig[Any, _, _, $ctx ]]]
164
+ $argSigsSymbol: scala.Seq[scala.Seq[cask.router.ArgSig[Any, _, _, Any ]]]
166
165
) =>
167
166
cask.router.Runtime.validate(Seq(.. ${readArgs.flatten.toList})).map{
168
167
case Seq(.. ${argNames.flatten.toList}) => $convertToResultType( $methodCall)
0 commit comments