diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index f7351bf691..7935540356 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -244,7 +244,7 @@ namespace ts { Property_0_does_not_exist_on_type_1: { code: 2339, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword." }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'." }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 9fd08ef9bc..0b4c0fdf97 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -965,7 +965,7 @@ "category": "Error", "code": 2341 }, - "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.": { + "An index expression argument must be of type 'string', 'number', 'symbol', or 'any'.": { "category": "Error", "code": 2342 }, diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt index 9e003197e4..2ea5a2f413 100644 --- a/tests/baselines/reference/indexTypeCheck.errors.txt +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type ' 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(51,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ==== tests/cases/compiler/indexTypeCheck.ts (7 errors) ==== @@ -72,7 +72,7 @@ tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression yellow[blue]; // error ~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. var x:number[]; x[0]; diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt index b2f3bd9d82..ef50db9e4e 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,17): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,17): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,63): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? -tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,33): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,33): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,79): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? @@ -59,12 +59,12 @@ tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,79): error TS // ElementAccessExpressions can only contain one expression. There should be a parse error here. var foods = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt index d9cd90a48f..7d496f8775 100644 --- a/tests/baselines/reference/propertyAccess.errors.txt +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(45,14): error TS2339: Property 'qqq' does not exist on type '{ 10: string; x: string; y: number; z: { n: string; m: number; o: () => boolean; }; 'literal property': number; }'. -tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(80,10): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. -tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(117,10): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. -tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,12): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(80,10): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. +tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(117,10): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. +tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,12): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ==== tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts (4 errors) ==== @@ -88,7 +88,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,12): er // Bracket notation property access using value of other type on type with numeric index signature and no string index signature var ll = numIndex[someObject]; // Error ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. // Bracket notation property access using string value on type with string index signature and no numeric index signature var mm = strIndex['N']; @@ -127,7 +127,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,12): er // Bracket notation property access using values of other types on type with no index signatures var uu = noIndex[someObject]; // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. // Bracket notation property access using numeric value on type with numeric index signature and string index signature var vv = noIndex[32]; @@ -152,7 +152,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,12): er // Bracket notation property access using value of other type on type with numeric index signature and no string index signature and string index signature var zzzz = bothIndex[someObject]; // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. var x1 = numIndex[stringOrNumber]; var x1: any; diff --git a/tests/baselines/reference/superSymbolIndexedAccess3.errors.txt b/tests/baselines/reference/superSymbolIndexedAccess3.errors.txt index 7f25510e00..1cac31dec4 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess3.errors.txt +++ b/tests/baselines/reference/superSymbolIndexedAccess3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess3.ts(11,16): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess3.ts(11,16): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ==== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess3.ts (1 errors) ==== @@ -14,6 +14,6 @@ tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess [symbol]() { return super[Bar](); ~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. } } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty53.errors.txt b/tests/baselines/reference/symbolProperty53.errors.txt index 7658744eb5..03002cd92b 100644 --- a/tests/baselines/reference/symbolProperty53.errors.txt +++ b/tests/baselines/reference/symbolProperty53.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty53.ts(2,5): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/Symbols/symbolProperty53.ts(5,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. +tests/cases/conformance/es6/Symbols/symbolProperty53.ts(5,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. ==== tests/cases/conformance/es6/Symbols/symbolProperty53.ts (2 errors) ==== @@ -11,4 +11,4 @@ tests/cases/conformance/es6/Symbols/symbolProperty53.ts(5,1): error TS2342: An i obj[Symbol.for]; ~~~~~~~~~~~~~~~ -!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. \ No newline at end of file +!!! error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'. \ No newline at end of file