Fix generic structs with non-generic interface as type parameter.
This commit is contained in:
parent
88182b9b30
commit
3119bb5fab
2 changed files with 7 additions and 4 deletions
|
@ -338,18 +338,22 @@ private:
|
||||||
if (liteMode) {
|
if (liteMode) {
|
||||||
return kj::strTree("org.capnproto.Capability.", suffix);
|
return kj::strTree("org.capnproto.Capability.", suffix);
|
||||||
}
|
}
|
||||||
|
auto interfaceSuffix = kj::str(suffix);
|
||||||
|
if(suffix == kj::str("Builder") || suffix == kj::str("Reader")) {
|
||||||
|
interfaceSuffix = kj::str("Client");
|
||||||
|
}
|
||||||
auto interfaceSchema = type.asInterface();
|
auto interfaceSchema = type.asInterface();
|
||||||
if (interfaceSchema.getProto().getIsGeneric()) {
|
if (interfaceSchema.getProto().getIsGeneric()) {
|
||||||
auto typeArgs = getTypeArguments(interfaceSchema, interfaceSchema, kj::str(suffix));
|
auto typeArgs = getTypeArguments(interfaceSchema, interfaceSchema, kj::str(suffix));
|
||||||
return kj::strTree(
|
return kj::strTree(
|
||||||
javaFullName(interfaceSchema), ".", suffix, "<",
|
javaFullName(interfaceSchema), ".", interfaceSuffix, "<",
|
||||||
kj::StringTree(KJ_MAP(arg, typeArgs){
|
kj::StringTree(KJ_MAP(arg, typeArgs){
|
||||||
return kj::strTree(arg);
|
return kj::strTree(arg);
|
||||||
}, ", "),
|
}, ", "),
|
||||||
">"
|
">"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return kj::strTree(javaFullName(type.asInterface()), ".", suffix);
|
return kj::strTree(javaFullName(type.asInterface()), ".", interfaceSuffix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case schema::Type::LIST:
|
case schema::Type::LIST:
|
||||||
|
|
|
@ -11,8 +11,7 @@ import static org.capnproto.ClientHook.NULL_CAPABILITY_BRAND;
|
||||||
public final class Capability {
|
public final class Capability {
|
||||||
|
|
||||||
public static abstract class Factory<T extends ClientBase>
|
public static abstract class Factory<T extends ClientBase>
|
||||||
implements FromPointerReader<T>,
|
implements PointerFactory<T, T>,
|
||||||
FromPointerBuilder<T>,
|
|
||||||
SetPointerBuilder<T, T> {
|
SetPointerBuilder<T, T> {
|
||||||
|
|
||||||
public abstract T newClient(ClientHook hook);
|
public abstract T newClient(ClientHook hook);
|
||||||
|
|
Loading…
Reference in a new issue