mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update baselines
After merging with master, even erroneous tests generate types and symbols baselines
This commit is contained in:
@@ -268,3 +268,34 @@ function f20<T, U>(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) {
|
||||
>k2 : Symbol(k2, Decl(keyofAndIndexedAccessErrors.ts, 69, 37))
|
||||
>k1 : Symbol(k1, Decl(keyofAndIndexedAccessErrors.ts, 69, 19))
|
||||
}
|
||||
|
||||
// Repro from #17166
|
||||
function f3<T, K extends keyof T>(obj: T, k: K, value: T[K]): void {
|
||||
>f3 : Symbol(f3, Decl(keyofAndIndexedAccessErrors.ts, 78, 1))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 81, 12))
|
||||
>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 81, 14))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 81, 12))
|
||||
>obj : Symbol(obj, Decl(keyofAndIndexedAccessErrors.ts, 81, 34))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 81, 12))
|
||||
>k : Symbol(k, Decl(keyofAndIndexedAccessErrors.ts, 81, 41))
|
||||
>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 81, 14))
|
||||
>value : Symbol(value, Decl(keyofAndIndexedAccessErrors.ts, 81, 47))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 81, 12))
|
||||
>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 81, 14))
|
||||
|
||||
for (let key in obj) {
|
||||
>key : Symbol(key, Decl(keyofAndIndexedAccessErrors.ts, 82, 12))
|
||||
>obj : Symbol(obj, Decl(keyofAndIndexedAccessErrors.ts, 81, 34))
|
||||
|
||||
k = key // error, keyof T =/=> K
|
||||
>k : Symbol(k, Decl(keyofAndIndexedAccessErrors.ts, 81, 41))
|
||||
>key : Symbol(key, Decl(keyofAndIndexedAccessErrors.ts, 82, 12))
|
||||
|
||||
value = obj[key]; // error, T[keyof T] =/=> T[K]
|
||||
>value : Symbol(value, Decl(keyofAndIndexedAccessErrors.ts, 81, 47))
|
||||
>obj : Symbol(obj, Decl(keyofAndIndexedAccessErrors.ts, 81, 34))
|
||||
>key : Symbol(key, Decl(keyofAndIndexedAccessErrors.ts, 82, 12))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -299,3 +299,37 @@ function f20<T, U>(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) {
|
||||
>k2 : keyof (T & U)
|
||||
>k1 : keyof (T | U)
|
||||
}
|
||||
|
||||
// Repro from #17166
|
||||
function f3<T, K extends keyof T>(obj: T, k: K, value: T[K]): void {
|
||||
>f3 : <T, K extends keyof T>(obj: T, k: K, value: T[K]) => void
|
||||
>T : T
|
||||
>K : K
|
||||
>T : T
|
||||
>obj : T
|
||||
>T : T
|
||||
>k : K
|
||||
>K : K
|
||||
>value : T[K]
|
||||
>T : T
|
||||
>K : K
|
||||
|
||||
for (let key in obj) {
|
||||
>key : keyof T
|
||||
>obj : T
|
||||
|
||||
k = key // error, keyof T =/=> K
|
||||
>k = key : keyof T
|
||||
>k : K
|
||||
>key : keyof T
|
||||
|
||||
value = obj[key]; // error, T[keyof T] =/=> T[K]
|
||||
>value = obj[key] : T[keyof T]
|
||||
>value : T[K]
|
||||
>obj[key] : T[keyof T]
|
||||
>obj : T
|
||||
>key : keyof T
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts ===
|
||||
// test for #15371
|
||||
function f<T extends object, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>f : Symbol(f, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 28))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 48))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 58))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 28))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 58))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 1, 48))
|
||||
}
|
||||
function g<T extends null, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>g : Symbol(g, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 3, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 26))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 46))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 56))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 26))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 56))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 4, 46))
|
||||
}
|
||||
function h<T extends undefined, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>h : Symbol(h, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 6, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 31))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 51))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 61))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 31))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 61))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 7, 51))
|
||||
}
|
||||
function i<T extends void, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>i : Symbol(i, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 9, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 26))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 46))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 56))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 26))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 56))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 10, 46))
|
||||
}
|
||||
function j<T extends never, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>j : Symbol(j, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 12, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 27))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 47))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 57))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 27))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 57))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 13, 47))
|
||||
}
|
||||
function k<T extends number, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>k : Symbol(k, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 15, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 28))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 48))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 58))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 28))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 58))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 16, 48))
|
||||
}
|
||||
function o<T extends string, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>o : Symbol(o, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 18, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 28))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 48))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 58))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 28))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 58))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 19, 48))
|
||||
}
|
||||
function l<T extends {}, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>l : Symbol(l, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 21, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 24))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 44))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 54))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 24))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 54))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 22, 44))
|
||||
}
|
||||
function m<T extends { a: number }, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>m : Symbol(m, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 24, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 11))
|
||||
>a : Symbol(a, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 22))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 35))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 55))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 65))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 35))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 65))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 25, 55))
|
||||
}
|
||||
function n<T extends { [s: string]: number }, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>n : Symbol(n, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 27, 1))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 24))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 45))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 11))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 65))
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 75))
|
||||
>T : Symbol(T, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 11))
|
||||
>P : Symbol(P, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 45))
|
||||
|
||||
tp = s;
|
||||
>tp : Symbol(tp, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 75))
|
||||
>s : Symbol(s, Decl(nonPrimitiveConstraintOfIndexAccessType.ts, 28, 65))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts ===
|
||||
// test for #15371
|
||||
function f<T extends object, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>f : <T extends object, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function g<T extends null, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>g : <T extends null, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>null : null
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function h<T extends undefined, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>h : <T extends undefined, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function i<T extends void, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>i : <T extends void, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function j<T extends never, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>j : <T extends never, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function k<T extends number, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>k : <T extends number, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function o<T extends string, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>o : <T extends string, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function l<T extends {}, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>l : <T extends {}, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function m<T extends { a: number }, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>m : <T extends { a: number; }, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>a : number
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
function n<T extends { [s: string]: number }, P extends keyof T>(s: string, tp: T[P]): void {
|
||||
>n : <T extends { [s: string]: number; }, P extends keyof T>(s: string, tp: T[P]) => void
|
||||
>T : T
|
||||
>s : string
|
||||
>P : P
|
||||
>T : T
|
||||
>s : string
|
||||
>tp : T[P]
|
||||
>T : T
|
||||
>P : P
|
||||
|
||||
tp = s;
|
||||
>tp = s : string
|
||||
>tp : T[P]
|
||||
>s : string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user