-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Annotated type variables can be written out to typescript with an invalid type name. This was noticed on a properties, but it could be wrong elsewhere.
Example that fails:
@TsInterface
@TsName(namespace = "myapp")
public interface MyOptional<T> {
@JsProperty
@JsNullable
T getValue();
}As @JsNullable is a TYPE_USE annotation, it apparently is attached to the T instead of the method, and accidentally is toString()'d when the type is written out in TS.
Expected output:
export namespace myapp {
interface MyOptional<T> {
get value(): null|T;
// or this might also be valid, still not sure why it sometimes changes
//readonly value?: null | T;
}
}Actual output:
export namespace myapp {
export interface JsOptional<T> {
readonly value?:null|@jsinterop.annotations.JsNullable T;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels