mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
426 B
TypeScript
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 {}
|