Open Schahen opened 4 years ago
more complete example
interface SomeOtherInterface {
ping: <T>(arg: T) => T;
pong<D>(arg: D): D;
cached: {
<T extends (...args: any[]) => any>(func: T) => any): T;
};
}
A good package for tracking success is fp-ts
which has tons of these issues.
I'm running into this issue running dukat against @types/google-protobuf
. The following two functions from the Message
class produce kotlin code which does not compile:
serializeBinaryExtensions(
proto: Message,
writer: BinaryWriter,
extensions: { [key: number]: ExtensionFieldBinaryInfo<Message> },
getExtensionFn: <T>(fieldInfo: ExtensionFieldInfo<T>) => T): void
readBinaryExtension(
proto: Message,
reader: BinaryReader,
extensions: {[key: number]: ExtensionFieldBinaryInfo<Message>},
setExtensionFn: <T>(fieldInfo: ExtensionFieldInfo<T>,
val: T) => void): void
If someone could point me in the right direction, I would be happy to try to fix this issue.
This code
is translated to:
Which won't compiled because we can not have standalone generic params in members. Actually, I am aware of this problem in general and we convert generated interfaces accordingly, for instance:
is converted to:
It's just that we need to generalise this practice