mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
69 lines
2.0 KiB
Plaintext
69 lines
2.0 KiB
Plaintext
deeplyNestedCheck.ts(34,25): error TS2741: Property 'i' is missing in type '{}' but required in type 'H'.
|
|
deeplyNestedCheck.ts(52,35): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
deeplyNestedCheck.ts(53,50): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
|
|
==== deeplyNestedCheck.ts (3 errors) ====
|
|
// Repro from #14794
|
|
|
|
interface DataSnapshot<X = {}> {
|
|
child(path: string): DataSnapshot;
|
|
}
|
|
|
|
interface Snapshot<T> extends DataSnapshot {
|
|
child<U extends Extract<keyof T, string>>(path: U): Snapshot<T[U]>;
|
|
}
|
|
|
|
// Repro from 34619
|
|
|
|
interface A { b: B[] }
|
|
interface B { c: C }
|
|
interface C { d: D[] }
|
|
interface D { e: E[] }
|
|
interface E { f: F[] }
|
|
interface F { g: G }
|
|
interface G { h: H[] }
|
|
interface H { i: string }
|
|
|
|
const x: A = {
|
|
b: [
|
|
{
|
|
c: {
|
|
d: [
|
|
{
|
|
e: [
|
|
{
|
|
f: [
|
|
{
|
|
g: {
|
|
h: [
|
|
{
|
|
~
|
|
// i: '',
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
},
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2741: Property 'i' is missing in type '{}' but required in type 'H'.
|
|
!!! related TS2728 deeplyNestedCheck.ts:20:15: 'i' is declared here.
|
|
],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
],
|
|
};
|
|
|
|
// Repro from 34619
|
|
|
|
const a1: string[][][][][] = [[[[[42]]]]];
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
const a2: string[][][][][][][][][][] = [[[[[[[[[[42]]]]]]]]]];
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|