mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
21 lines
644 B
Plaintext
21 lines
644 B
Plaintext
hidingIndexSignatures.ts(10,1): error TS2454: Variable 'b' is used before being assigned.
|
|
hidingIndexSignatures.ts(12,1): error TS2454: Variable 'a' is used before being assigned.
|
|
|
|
|
|
==== hidingIndexSignatures.ts (2 errors) ====
|
|
interface A {
|
|
[a: string]: {};
|
|
}
|
|
|
|
interface B extends A {
|
|
[a: string]: number; // Number is not a subtype of string. Should error.
|
|
}
|
|
|
|
var b: B;
|
|
b[""]; // Should be number
|
|
~
|
|
!!! error TS2454: Variable 'b' is used before being assigned.
|
|
var a: A;
|
|
a[""]; // Should be {}
|
|
~
|
|
!!! error TS2454: Variable 'a' is used before being assigned. |