mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
48 lines
936 B
TypeScript
48 lines
936 B
TypeScript
//// [tests/cases/conformance/types/members/duplicateStringIndexers.ts] ////
|
|
|
|
//// [duplicateStringIndexers.ts]
|
|
// it is an error to have duplicate index signatures of the same kind in a type
|
|
|
|
namespace test {
|
|
interface Number {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
}
|
|
|
|
interface String {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
}
|
|
|
|
interface Array<T> {
|
|
[x: string]: T;
|
|
[x: string]: T;
|
|
}
|
|
|
|
class C {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
}
|
|
|
|
interface I {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
}
|
|
|
|
var a: {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
}
|
|
}
|
|
|
|
|
|
//// [duplicateStringIndexers.js]
|
|
"use strict";
|
|
// it is an error to have duplicate index signatures of the same kind in a type
|
|
var test;
|
|
(function (test) {
|
|
class C {
|
|
}
|
|
var a;
|
|
})(test || (test = {}));
|