-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The union type cannot be determined using 'string []' to determine the type #55246
Comments
I used const readonly, but still couldn't get it |
Please properly fill out the Version & Regression Information section. Tuples aren't treated as discriminants; this is essentially a duplicate of #48500. |
Can we release the first level of derivation? |
Add keywords |
If I understand you correctly (and that's a big if, there seems to be a language barrier here), what you're asking for would require #18758 |
"This changed between versions 4.9 and 5.1" <-- this means that it was working as you desired in version 4.9 and is broken in version 5.1. Is that really what you mean? I'm going to disengage now because it seems like there's a communication problem and I don't know how to fix it. Good luck. |
Can it only support |
A reference-typed discriminant is difficult to reason about and would break a lot of assumptions that CFA uses. These just aren't supported and are unlikely to be supported in the future. |
The initial requirement was interface TableProps<T = any> {
// dataIndex support `a | b | [a] | [b]`
columns: { dataIndex: keyof T | [keyof T]; render: (value: T[keyof T]) => any }[];
}
export const data: TableProps<{ a: string; b: number }> = {
columns: [
{ dataIndex: ['a'], render: value => value }, // render value type is string
{ dataIndex: ['b'], render: value => value }, // render value type is number
],
}; I don't know how to write the type either |
Can I convert |
This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
input
['a']
,getType
data
isany
🙂 Expected behavior
input
['a']
,getType
data
isa
The text was updated successfully, but these errors were encountered: