Accept new baselines
This commit is contained in:
parent
3050c62251
commit
6d60f699ca
4 changed files with 49 additions and 0 deletions
|
@ -205,3 +205,9 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS23
|
|||
cb(param[0]);
|
||||
}
|
||||
|
||||
// Repro from #31149
|
||||
|
||||
function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
|
||||
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
|
||||
}
|
||||
|
|
@ -126,6 +126,12 @@ function fn2<T extends Array<string>>(param: T, cb: (element: T[number]) => void
|
|||
cb(param[0]);
|
||||
}
|
||||
|
||||
// Repro from #31149
|
||||
|
||||
function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
|
||||
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
|
||||
}
|
||||
|
||||
|
||||
//// [keyofAndIndexedAccess2.js]
|
||||
function f1(obj, k0, k1, k2) {
|
||||
|
@ -207,3 +213,7 @@ function fn(param, cb) {
|
|||
function fn2(param, cb) {
|
||||
cb(param[0]);
|
||||
}
|
||||
// Repro from #31149
|
||||
function fn3(param, cb) {
|
||||
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
|
||||
}
|
||||
|
|
|
@ -471,3 +471,20 @@ function fn2<T extends Array<string>>(param: T, cb: (element: T[number]) => void
|
|||
>param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 123, 38))
|
||||
}
|
||||
|
||||
// Repro from #31149
|
||||
|
||||
function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
|
||||
>fn3 : Symbol(fn3, Decl(keyofAndIndexedAccess2.ts, 125, 1))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 129, 13))
|
||||
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --))
|
||||
>param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 129, 46))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 129, 13))
|
||||
>cb : Symbol(cb, Decl(keyofAndIndexedAccess2.ts, 129, 55))
|
||||
>element : Symbol(element, Decl(keyofAndIndexedAccess2.ts, 129, 61))
|
||||
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 129, 13))
|
||||
|
||||
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
|
||||
>cb : Symbol(cb, Decl(keyofAndIndexedAccess2.ts, 129, 55))
|
||||
>param : Symbol(param, Decl(keyofAndIndexedAccess2.ts, 129, 46))
|
||||
}
|
||||
|
||||
|
|
|
@ -471,3 +471,19 @@ function fn2<T extends Array<string>>(param: T, cb: (element: T[number]) => void
|
|||
>0 : 0
|
||||
}
|
||||
|
||||
// Repro from #31149
|
||||
|
||||
function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
|
||||
>fn3 : <T extends readonly string[]>(param: T, cb: (element: T[number]) => void) => void
|
||||
>param : T
|
||||
>cb : (element: T[number]) => void
|
||||
>element : T[number]
|
||||
|
||||
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
|
||||
>cb(param[0]) : void
|
||||
>cb : (element: T[number]) => void
|
||||
>param[0] : string
|
||||
>param : T
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue