I get an error when I try to use a record type, a field of which is defined with a scoped polymorphic type.
Code:
module ColumnDef = {
type cellProps<'tData, 'cellData> = {getValue: unit => 'cellData}
type t<'tData> = {
id: string,
// The types of accessorFn and cell fields uses a scoped polymorphic type 'cellData: https://rescript-lang.org/docs/manual/latest/scoped-polymorphic-types
accessorFn: 'cellData. 'tData => 'cellData,
cell?: 'cellData. cellProps<'tData, 'cellData> => React.element,
enableSorting?: bool,
}
}
type t = {
id: string,
rank: int,
}
let columnDefs: array<ColumnDef.t<t>> = [
{
id: "ID",
accessorFn: t => t.id,
},
{
id: "Rank",
accessorFn: t => t.rank,
},
]
Error:
[E] Line 21, column 16:
This field value has type t => string
which is less general than 'cellData. 'tData => 'cellData
Can someone help me solve it?