mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-23 18:48:40 -05:00
Update tests
This commit is contained in:
@@ -155,7 +155,7 @@ function fx2<T extends Record<keyof T, string>, K extends keyof T>(obj: T, key:
|
||||
}
|
||||
|
||||
function fx3<T extends Record<keyof T, string> | undefined, K extends keyof T>(obj: T, key: K) {
|
||||
const x1 = obj[key]; // Error
|
||||
const x1 = obj[key];
|
||||
const x2 = obj && obj[key];
|
||||
}
|
||||
|
||||
@@ -166,8 +166,8 @@ class TableBaseEnum<
|
||||
InternalSpec extends Record<keyof PublicSpec, any> | undefined = undefined> {
|
||||
m() {
|
||||
let iSpec = null! as InternalSpec;
|
||||
iSpec[null! as keyof InternalSpec]; // Error, object possibly undefined
|
||||
iSpec[null! as keyof PublicSpec]; // Error, object possibly undefined
|
||||
iSpec[null! as keyof InternalSpec];
|
||||
iSpec[null! as keyof PublicSpec]; // Error
|
||||
if (iSpec === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user