From c7c1d6b03b98572769374fec46dd9433abc817eb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 19 Nov 2014 22:15:32 -0800 Subject: [PATCH] Remove unnecessary state from the parser. --- src/compiler/checker.ts | 2 +- src/compiler/parser.ts | 29 +- tests/baselines/reference/giant.errors.txt | 602 +++++++++++++----- ...tiesErrorFromNotUsingIdentifier.errors.txt | 5 +- 4 files changed, 446 insertions(+), 192 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 117422366a..db36821310 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1784,7 +1784,7 @@ module ts { } else { // If there are no specified types, try to infer it from the body of the get accessor if it exists. - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } // Otherwise, fall back to 'any'. diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index affc4fd866..56dc06250f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -842,10 +842,9 @@ module ts { var identifierCount = 0; var nodeCount = 0; var lineStarts: number[]; - var isInStrictMode = false; + var isInStrictMode = false; var lookAheadMode = LookAheadMode.NotLookingAhead; - var inAmbientContext = false; function getLineStarts(): number[] { return lineStarts || (lineStarts = computeLineStarts(sourceText)); @@ -3046,16 +3045,7 @@ module ts { node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - - // A common error is to try to declare an accessor in an ambient class. - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseFunctionBlock(/* ignoreMissingOpenBrace */ false); - } - + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } @@ -3260,13 +3250,7 @@ module ts { var node = createNode(SyntaxKind.ModuleDeclaration, pos); node.flags = flags; node.name = parseStringLiteral(); - - // For error recovery, just in case the user forgot the declare modifier on this ambient - // external module, treat it as ambient anyway. - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } @@ -3345,10 +3329,6 @@ module ts { } } - var saveInAmbientContext = inAmbientContext; - if (modifiers && modifiers.flags & NodeFlags.Ambient) { - inAmbientContext = true; - } var flags = modifiers ? modifiers.flags : 0; var result: Declaration; switch (token) { @@ -3394,7 +3374,6 @@ module ts { result.modifiers = modifiers; } - inAmbientContext = saveInAmbientContext; return result; } @@ -3494,7 +3473,6 @@ module ts { var rootNodeFlags: NodeFlags = 0; if (fileExtensionIs(filename, ".d.ts")) { rootNodeFlags = NodeFlags.DeclarationFile; - inAmbientContext = true; } file = createRootNode(SyntaxKind.SourceFile, 0, sourceText.length, rootNodeFlags); file.filename = normalizePath(filename); @@ -4493,6 +4471,9 @@ module ts { else if (inAmbientContext) { return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + } else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); } diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index d9d96f5abf..767c419952 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -1,86 +1,187 @@ -tests/cases/compiler/giant.ts(25,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(27,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(29,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(31,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(35,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(37,1): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(89,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(91,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(93,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(95,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(99,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(101,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(168,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(170,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(172,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(174,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(178,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(180,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(283,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(285,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(287,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(289,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(293,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(295,1): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(347,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(349,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(351,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(353,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(357,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(359,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(426,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(428,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(430,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(432,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(436,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(438,5): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(24,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(26,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(61,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(90,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(125,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(169,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(204,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(233,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(238,35): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(240,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(243,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(244,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(245,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(246,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(247,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(248,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(249,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(250,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(251,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(252,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(254,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(255,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(256,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(257,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(258,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(262,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(267,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(267,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(284,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(319,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(348,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(383,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(427,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(462,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(491,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(496,35): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(498,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(501,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(502,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(503,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(504,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(505,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(506,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(507,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(508,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(509,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(510,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(512,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(513,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(514,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(515,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(516,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(520,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(525,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(525,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(532,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(534,20): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(537,17): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(538,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(539,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(540,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(541,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(542,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(543,19): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(544,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(545,28): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(546,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(548,17): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(549,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(550,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(551,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(552,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(556,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(558,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(561,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(563,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(587,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(606,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(611,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(611,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(616,42): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(621,26): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(621,29): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(623,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(626,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(628,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(653,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(672,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(676,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(676,33): error TS1036: Statements are not allowed in ambient contexts. tests/cases/compiler/giant.ts(23,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(24,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(24,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(25,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(26,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(27,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(28,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(28,17): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(29,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(30,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(33,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(36,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(88,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(89,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(90,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(91,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(92,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(92,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(93,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(94,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(97,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(100,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(167,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(168,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(169,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(170,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(171,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(171,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(172,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(173,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(176,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(179,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'. @@ -96,51 +197,42 @@ tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(282,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(283,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(284,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(285,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(286,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(286,17): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(287,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(288,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(291,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(294,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(346,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(347,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(348,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(349,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(350,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(350,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(351,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(352,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(355,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(358,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(425,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(426,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(427,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(428,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(429,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(429,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(430,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(431,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(434,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(437,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'. @@ -170,7 +262,7 @@ tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required. -==== tests/cases/compiler/giant.ts (170 errors) ==== +==== tests/cases/compiler/giant.ts (262 errors) ==== /* Prefixes @@ -198,58 +290,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -274,8 +360,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -306,58 +398,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -382,8 +468,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -413,6 +505,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export module eM { }; export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } @@ -429,58 +523,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -505,8 +593,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -536,64 +630,108 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export module eM { }; export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -612,58 +750,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -688,8 +820,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -720,58 +858,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -796,8 +928,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -827,6 +965,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export module eM { }; export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } @@ -843,58 +983,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -919,8 +1053,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -950,64 +1090,108 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export module eM { }; export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -1015,61 +1199,105 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all } export declare var eaV; export declare function eaF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. class C { constructor () { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tV; static tF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. } interface I { //Call Signature @@ -1094,8 +1322,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -1115,28 +1349,56 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all module M { var V; function F() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } export declare var eaV + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. export declare function eaF() { }; + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export declare class eaC { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. export declare module eaM { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. } export var eV; export function eF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { constructor () { } + ~ +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tV static tF() { } + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. } export interface eI { //Call Signature @@ -1162,8 +1424,14 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; + ~~ +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -1183,10 +1451,18 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export module eM { var V; function F() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } module M { } export var eV; export function eF() { }; + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~ +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt index 33672c3d54..cc92b9a038 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -11,13 +11,12 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. -==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (17 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (16 errors) ==== // errors var y = { "stringLiteral", @@ -29,8 +28,6 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr get e, ~ !!! error TS1005: '(' expected. - ~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. set f, ~ !!! error TS1005: '(' expected.