type a = {
name: string,
age: int,
}
type b<'t> = {
...a,
foo: 't,
}
type c = {
...a,
foo:string,
}
let funA = (foo: a) => {
Console.log(foo)
}
let fooB: b<int> = {
name: "rsb",
age: 12,
foo: 1,
}
let fooC :c = {
name: "rsb",
age: 12,
foo: "c",
}
funA(fooC :> a)
// ERROR: Type b<int> is not a subtype of a
funA(fooB :> a)
Since PR introducing this feature doesn’t state anything about type variables and I couldn’t find anything about it in the docs, I don’t think it’s supported. But I really don’t know.
@cristianoc Are type variables in record type coercion supported?