mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-05 16:54:54 -05:00
Add additional tests
This commit is contained in:
@@ -16,6 +16,18 @@ function f2<T extends string | number | undefined, U extends string | null | und
|
||||
|
||||
type T1 = (string | number | undefined) & (string | null | undefined); // string | undefined
|
||||
|
||||
function f3<T extends string | number | undefined>(x: T & (number | object | undefined)) {
|
||||
const y: number | undefined = x;
|
||||
}
|
||||
|
||||
function f4<T extends string | number>(x: T & (number | object)) {
|
||||
const y: number = x;
|
||||
}
|
||||
|
||||
function f5<T, U extends keyof T>(x: keyof T & U) {
|
||||
let y: keyof any = x;
|
||||
}
|
||||
|
||||
// Repro from #23648
|
||||
|
||||
type Example<T, U> = { [K in keyof T]: K extends keyof U ? UnexpectedError<K> : NoErrorHere<K> }
|
||||
|
||||
Reference in New Issue
Block a user