Closed kevinresol closed 4 years ago
Hmm, random guess, but if you route over typedef FooApi = BaseApi<Foo>
does it work? ^^
but if you route over
typedef FooApi = BaseApi<Foo>
does it work? ^^
Surprisingly, yes! (case 1 below)
But in fact I am trying to extend interfaces... (case 2)
package;
using tink.CoreApi;
class Main {
static function main() {
var remote = new tink.web.proxy.Remote<TypedefApi>(null, null); // works
var remote = new tink.web.proxy.Remote<ExtendApi>(null, null); // fails
var remote = new tink.web.proxy.Remote<ExtendTypedefApi>(null, null); // fails
}
}
interface BaseApi<T> {
@:get('/')
function get():Promise<T>;
}
typedef TypedefApi = BaseApi<{foo:String}>;
interface ExtendApi extends BaseApi<{foo:String}> {}
interface ExtendTypedefApi extends TypedefApi {}
tink_json cannot parse BaseApi.T. For parsing custom data, please see https://github.com/haxetink/tink_json#custom-abstracts
I think this should work because the actual usage must contain a concrete type for
T
?