You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several cases where type parameters are not handled properly. Here are some examples:
Object type
source:
declare class B<T> {
f(x: { f: Array<T> })
}
generated:
external interface `T$0` {
var f: Array<T>
}
external open class B<T> {
open fun f(x: `T$0`)
}
Interface T$0 is lacking type parameter T.
Type alias with type parameter
source:
type Or<T, U> = { f: T } | { g: U }
declare class B {
f(x: Or<number, string>)
}
generated:
external interface `T$0`<T> {
var f: T
}
external interface `T$1`<U> {
var g: U
}
external open class B {
open fun f(x: `T$0`<T>)
open fun f(x: `T$1`<U>)
}
T and U are not substituted with number and string.
Default type parameter inside type alias
source:
type ComplexType<A, B, C = Array<A>> = A | B | C
declare class A {
x: ComplexType<number, string>
}
generated:
external open class A {
open var x: dynamic /* Number | String | C */
}
C is not substituted with Array<Number>.
The text was updated successfully, but these errors were encountered:
trilis
changed the title
Type parameters are not substituted or generated with actual types in some cases
Type parameters are not substituted or generated in some cases
Aug 4, 2020
There are several cases where type parameters are not handled properly. Here are some examples:
Object type
source:
generated:
Interface
T$0
is lacking type parameterT
.Type alias with type parameter
source:
generated:
T
andU
are not substituted withnumber
andstring
.Default type parameter inside type alias
source:
generated:
C is not substituted with
Array<Number>
.The text was updated successfully, but these errors were encountered: