Files
tsgo/testdata/baselines/reference/submodule/compiler/hidingIndexSignatures.js

23 lines
426 B
TypeScript

//// [tests/cases/compiler/hidingIndexSignatures.ts] ////
//// [hidingIndexSignatures.ts]
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
var a: A;
a[""]; // Should be {}
//// [hidingIndexSignatures.js]
"use strict";
var b;
b[""]; // Should be number
var a;
a[""]; // Should be {}