mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
22 lines
739 B
Plaintext
22 lines
739 B
Plaintext
duplicateErrorAssignability.ts(10,11): error TS2741: Property 'x' is missing in type 'B' but required in type 'A'.
|
|
duplicateErrorAssignability.ts(12,5): error TS2538: Type 'B' cannot be used as an index type.
|
|
|
|
|
|
==== duplicateErrorAssignability.ts (2 errors) ====
|
|
interface A {
|
|
x: number;
|
|
}
|
|
interface B {
|
|
y: string;
|
|
}
|
|
|
|
declare let b: B;
|
|
declare let a: A;
|
|
const x = a = b;
|
|
~
|
|
!!! error TS2741: Property 'x' is missing in type 'B' but required in type 'A'.
|
|
!!! related TS2728 duplicateErrorAssignability.ts:2:5: 'x' is declared here.
|
|
let obj: { 3: string } = { 3: "three" };
|
|
obj[x];
|
|
~
|
|
!!! error TS2538: Type 'B' cannot be used as an index type. |