-
Notifications
You must be signed in to change notification settings - Fork 12.8k
conditional generic Type assignable Error #47127
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
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Comments
Bisect to #46429 |
Simplified type EventWrapper<T> = {
event: T;
}
export type GetEventType<T extends string> =
T extends `${infer A} ${string}` ?
GetEventType<A>
: T extends keyof DocumentEventMap ?
EventWrapper<DocumentEventMap[T]>
: EventWrapper<Event>
function go<T extends string>(type: T, lisenter: (event: GetEventType<T>) => void) {
const src: EventWrapper<any> = null as any;
// OK in 4.4, error in 4.5
// Should be OK [?]; all terminuses of GetEventType<T> are EventWrapper<any>'s
const dst: GetEventType<T> = src;
} |
This was an announced breaking change: |
FYI @ahejlsberg for visibility anyway |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
π Search Terms
conditional
π Version & Regression Information
4.4.4
and4.5.2
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Type 'KonvaEventObject' is not assignable to type 'GetMultiType'
π Expected behavior
can assign type 'KonvaEventObject<NodeEventMap[T]>' to type 'GetMultiType'
The text was updated successfully, but these errors were encountered: