mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
901 B
Plaintext
27 lines
901 B
Plaintext
mergedInterfacesWithIndexers.ts(13,9): error TS2454: Variable 'a' is used before being assigned.
|
|
mergedInterfacesWithIndexers.ts(14,10): error TS2454: Variable 'a' is used before being assigned.
|
|
mergedInterfacesWithIndexers.ts(15,10): error TS2454: Variable 'a' is used before being assigned.
|
|
|
|
|
|
==== mergedInterfacesWithIndexers.ts (3 errors) ====
|
|
// indexers should behave like other members when merging interface declarations
|
|
|
|
interface A {
|
|
[x: number]: string;
|
|
}
|
|
|
|
|
|
interface A {
|
|
[x: string]: { length: number };
|
|
}
|
|
|
|
var a: A;
|
|
var r = a[1];
|
|
~
|
|
!!! error TS2454: Variable 'a' is used before being assigned.
|
|
var r2 = a['1'];
|
|
~
|
|
!!! error TS2454: Variable 'a' is used before being assigned.
|
|
var r3 = a['hi'];
|
|
~
|
|
!!! error TS2454: Variable 'a' is used before being assigned. |