diff --git a/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.js b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.js new file mode 100644 index 0000000000000..d509ae136fa9a --- /dev/null +++ b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.js @@ -0,0 +1,17 @@ +//// [comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts] +type PartialDeep = {[K in keyof T]?: PartialDeep}; +type Many = T | readonly T[]; + +interface Collection { + sortBy(...iteratees: Many>[]): Collection; +} + +const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>); + +export {}; + + +//// [comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.js] +"use strict"; +exports.__esModule = true; +var x = null; diff --git a/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.symbols b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.symbols new file mode 100644 index 0000000000000..55e387983e52d --- /dev/null +++ b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts === +type PartialDeep = {[K in keyof T]?: PartialDeep}; +>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17)) +>K : Symbol(K, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 24)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17)) +>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 17)) +>K : Symbol(K, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 24)) + +type Many = T | readonly T[]; +>Many : Symbol(Many, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 59)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 10)) + +interface Collection { +>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21)) + + sortBy(...iteratees: Many>[]): Collection; +>sortBy : Symbol(Collection.sortBy, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 25)) +>iteratees : Symbol(iteratees, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 4, 11)) +>Many : Symbol(Many, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 59)) +>PartialDeep : Symbol(PartialDeep, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 0, 0)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21)) +>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32)) +>T : Symbol(T, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 3, 21)) +} + +const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>); +>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 5)) +>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32)) +>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 21)) +>Collection : Symbol(Collection, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 1, 32)) +>x : Symbol(x, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 63)) +>y : Symbol(y, Decl(comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts, 7, 73)) + +export {}; + diff --git a/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.types b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.types new file mode 100644 index 0000000000000..edc8e82ee8747 --- /dev/null +++ b/tests/baselines/reference/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts === +type PartialDeep = {[K in keyof T]?: PartialDeep}; +>PartialDeep : PartialDeep + +type Many = T | readonly T[]; +>Many : Many + +interface Collection { + sortBy(...iteratees: Many>[]): Collection; +>sortBy : (...iteratees: Many>[]) => Collection +>iteratees : Many>[] +} + +const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>); +>x : Collection<{ x: number; }> +>x : number +>(null as any as Collection<{x: number, y: number}>) : Collection<{ x: number; y: number; }> +>null as any as Collection<{x: number, y: number}> : Collection<{ x: number; y: number; }> +>null as any : any +>null : null +>x : number +>y : number + +export {}; + diff --git a/tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts b/tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts new file mode 100644 index 0000000000000..4dc45c54005ee --- /dev/null +++ b/tests/cases/compiler/comparisonOfPartialDeepAndIndexedAccessTerminatesWithoutError.ts @@ -0,0 +1,11 @@ +// @strict: true +type PartialDeep = {[K in keyof T]?: PartialDeep}; +type Many = T | readonly T[]; + +interface Collection { + sortBy(...iteratees: Many>[]): Collection; +} + +const x: Collection<{x: number}> = (null as any as Collection<{x: number, y: number}>); + +export {};