fix #33427
This commit is contained in:
Daniel Rosenwasser
2019-10-10 10:13:36 -07:00
committed by GitHub
27 changed files with 61 additions and 61 deletions
+2 -2
View File
@@ -35008,12 +35008,12 @@ namespace ts {
typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType));
}
if (type.flags & TypeFlags.Union && allTypesAssignableToKind(type, TypeFlags.StringLiteral, /*strict*/ true)) {
if (type.flags & TypeFlags.Union && allTypesAssignableToKind(type, TypeFlags.StringOrNumberLiteral, /*strict*/ true)) {
return grammarErrorOnNode(parameter.name,
Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);
}
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_either_string_or_number);
}
if (!node.type) {
return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation);
+1 -1
View File
@@ -71,7 +71,7 @@
"category": "Error",
"code": 1022
},
"An index signature parameter type must be 'string' or 'number'.": {
"An index signature parameter type must be either 'string' or 'number'.": {
"category": "Error",
"code": 1023
},
@@ -1,4 +1,4 @@
tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/arraySigChecking.ts(18,27): error TS2322: Type 'void' is not assignable to type 'string'.
tests/cases/compiler/arraySigChecking.ts(22,13): error TS2322: Type 'number' is not assignable to type 'number[]'.
tests/cases/compiler/arraySigChecking.ts(22,16): error TS2322: Type 'number' is not assignable to type 'number[]'.
@@ -17,7 +17,7 @@ tests/cases/compiler/arraySigChecking.ts(22,16): error TS2322: Type 'number' is
var foo: { [index: any]; }; // expect an error here
~~~~~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
interface myInt {
@@ -1,4 +1,4 @@
tests/cases/compiler/a.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/a.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/a.ts(8,11): error TS2538: Type '1n' cannot be used as an index type.
tests/cases/compiler/a.ts(14,1): error TS2322: Type '123n' is not assignable to type 'string | number | symbol'.
tests/cases/compiler/a.ts(19,12): error TS2538: Type 'bigint' cannot be used as an index type.
@@ -13,7 +13,7 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be
interface BigIntIndex<E> {
[index: bigint]: E; // should error
~~~~~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
const arr: number[] = [1, 2, 3];
@@ -1,4 +1,4 @@
tests/cases/compiler/declarationEmitIndexTypeNotFound.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/declarationEmitIndexTypeNotFound.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/declarationEmitIndexTypeNotFound.ts(2,13): error TS2304: Cannot find name 'TypeNotFound'.
tests/cases/compiler/declarationEmitIndexTypeNotFound.ts(2,13): error TS4092: Parameter 'index' of index signature from exported interface has or is using private name 'TypeNotFound'.
@@ -7,7 +7,7 @@ tests/cases/compiler/declarationEmitIndexTypeNotFound.ts(2,13): error TS4092: Pa
export interface Test {
[index: TypeNotFound]: any;
~~~~~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'TypeNotFound'.
~~~~~~~~~~~~
@@ -1,7 +1,7 @@
tests/cases/compiler/genericIndexTypeHasSensibleErrorMessage.ts(1,33): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/genericIndexTypeHasSensibleErrorMessage.ts(1,33): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/compiler/genericIndexTypeHasSensibleErrorMessage.ts (1 errors) ====
type Wat<T extends string> = { [x: T]: string };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
@@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(10,21): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,22): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,26): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,22): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
@@ -36,7 +36,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
declare var d: { [x: C]: C };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
~
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
~
@@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(10,13): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,14): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,18): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,14): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,18): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,13): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
@@ -46,7 +46,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
var d: { [x: C]: C };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
~
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
~
@@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(10,13): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,14): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,18): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,14): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,18): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,13): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
@@ -46,7 +46,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
var d: { [x: I]: I };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
~
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
~
@@ -2,7 +2,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(10,21): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,22): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,26): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,22): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
@@ -36,7 +36,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
declare var d: { [x: C]: C };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
~
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
~
@@ -4,7 +4,7 @@ tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type '
tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'.
tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'.
tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/indexTypeCheck.ts(51,8): error TS2538: Type 'Blue' cannot be used as an index type.
@@ -58,7 +58,7 @@ tests/cases/compiler/indexTypeCheck.ts(51,8): error TS2538: Type 'Blue' cannot b
interface Magenta {
[p:Purple]; // error
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
var yellow: Yellow;
@@ -3,11 +3,11 @@ tests/cases/compiler/indexerConstraints2.ts(17,5): error TS2413: Numeric index t
tests/cases/compiler/indexerConstraints2.ts(26,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'.
tests/cases/compiler/indexerConstraints2.ts(34,6): error TS1336: An index signature parameter type cannot be a type alias. Consider writing '[n: number]: A' instead.
tests/cases/compiler/indexerConstraints2.ts(40,6): error TS1336: An index signature parameter type cannot be a type alias. Consider writing '[s: string]: A' instead.
tests/cases/compiler/indexerConstraints2.ts(46,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(46,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(52,6): error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
tests/cases/compiler/indexerConstraints2.ts(58,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(64,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(70,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(58,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/compiler/indexerConstraints2.ts(64,6): error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
tests/cases/compiler/indexerConstraints2.ts(70,6): error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
tests/cases/compiler/indexerConstraints2.ts(74,6): error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
tests/cases/compiler/indexerConstraints2.ts(79,6): error TS1336: An index signature parameter type cannot be a type alias. Consider writing '[key: string]: any' instead.
@@ -70,7 +70,7 @@ tests/cases/compiler/indexerConstraints2.ts(79,6): error TS1336: An index signat
interface N {
[b: AliasedBoolean]: A;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
type IndexableUnion = "foo" | "bar";
@@ -86,7 +86,7 @@ tests/cases/compiler/indexerConstraints2.ts(79,6): error TS1336: An index signat
interface P {
[u: NonIndexableUnion]: A;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
type NonIndexableUnion2 = string | number;
@@ -94,7 +94,7 @@ tests/cases/compiler/indexerConstraints2.ts(79,6): error TS1336: An index signat
interface Q {
[u: NonIndexableUnion2]: A;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
}
type NonIndexableUnion3 = "foo" | 42;
@@ -102,7 +102,7 @@ tests/cases/compiler/indexerConstraints2.ts(79,6): error TS1336: An index signat
interface R {
[u: NonIndexableUnion3]: A;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1337: An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
}
interface S {
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts (1 errors) ====
interface I {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts (1 errors) ====
class C {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts (1 errors) ====
var x: {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature6.ts(2,4): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature6.ts(2,4): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature6.ts (1 errors) ====
interface I {
[a:boolean]
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,12 +1,12 @@
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature8.ts(1,13): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature8.ts(2,14): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature8.ts(1,13): error TS1023: An index signature parameter type must be either 'string' or 'number'.
tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature8.ts(2,14): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature8.ts (2 errors) ====
var foo: { [index: any]; }; // expect an error here
~~~~~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
var foo2: { [index: RegExp]; }; // expect an error here
~~~~~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts (1 errors) ====
interface I {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts (1 errors) ====
class C {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,9 +1,9 @@
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts(2,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts (1 errors) ====
var x: {
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/Symbols/symbolProperty17.ts(3,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty17.ts(3,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty17.ts (1 errors) ====
@@ -6,7 +6,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty17.ts(3,6): error TS1023: An i
[Symbol.iterator]: number;
[s: symbol]: string;
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
"__@iterator": string;
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/Symbols/symbolProperty29.ts(5,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty29.ts(5,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty29.ts (1 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty29.ts(5,6): error TS1023: An i
}
[s: symbol]: () => { x: string };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/Symbols/symbolProperty30.ts(5,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty30.ts(5,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty30.ts (1 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty30.ts(5,6): error TS1023: An i
}
[s: symbol]: () => { x: number };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/Symbols/symbolProperty31.ts(7,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty31.ts(7,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty31.ts (1 errors) ====
@@ -10,5 +10,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty31.ts(7,6): error TS1023: An i
class C2 extends C1 {
[s: symbol]: () => { x: string };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/Symbols/symbolProperty32.ts(7,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty32.ts(7,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty32.ts (1 errors) ====
@@ -10,5 +10,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty32.ts(7,6): error TS1023: An i
class C2 extends C1 {
[s: symbol]: () => { x: number };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/Symbols/symbolProperty33.ts(1,18): error TS2449: Class 'C2' used before its declaration.
tests/cases/conformance/es6/Symbols/symbolProperty33.ts(7,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty33.ts(7,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty33.ts (2 errors) ====
@@ -14,5 +14,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty33.ts(7,6): error TS1023: An i
class C2 {
[s: symbol]: () => { x: string };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/Symbols/symbolProperty34.ts(1,18): error TS2449: Class 'C2' used before its declaration.
tests/cases/conformance/es6/Symbols/symbolProperty34.ts(7,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
tests/cases/conformance/es6/Symbols/symbolProperty34.ts(7,6): error TS1023: An index signature parameter type must be either 'string' or 'number'.
==== tests/cases/conformance/es6/Symbols/symbolProperty34.ts (2 errors) ====
@@ -14,5 +14,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty34.ts(7,6): error TS1023: An i
class C2 {
[s: symbol]: () => { x: number };
~
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
!!! error TS1023: An index signature parameter type must be either 'string' or 'number'.
}