From f22adf678534cd2269255ddb1b85e3c9c9ed2b17 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 15 Dec 2014 16:42:31 -0800 Subject: [PATCH] Move grammar checking: constructorDeclaration; there are still errors from incomplete grammar migration --- src/compiler/checker.ts | 32 ++++++++++++-- src/compiler/parser.ts | 6 +-- .../emptyGenericParamList.errors.txt | 8 ++-- ...implicitAnyInAmbientDeclaration.errors.txt | 2 +- ...licitAnyInAmbientDeclaration2.d.errors.txt | 2 +- ...ModuleWithStatementsOfEveryKind.errors.txt | 6 +-- .../parserComputedPropertyName34.errors.txt | 2 +- .../parserConstructorDeclaration12.errors.txt | 42 +++++++++---------- .../reference/protectedMembers.errors.txt | 2 +- .../templateStringInTaggedTemplate.errors.txt | 8 ++-- .../typesWithPrivateConstructor.errors.txt | 2 +- 11 files changed, 68 insertions(+), 44 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a259e3a5aa4..bc202d76371 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7157,8 +7157,7 @@ module ts { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType || - node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.ConstructSignature){ + else if (node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType || node.kind === SyntaxKind.CallSignature){ checkGrammarFunctionLikeDeclaration(node); } @@ -7241,6 +7240,9 @@ module ts { } function checkConstructorDeclaration(node: ConstructorDeclaration) { + // Grammar check on signature of constructor is done in checkSignatureDeclaration function + checkGrammarModifiers(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarConstructorTypeParameters(node) || checkGrammarConstructorTypeAnnotation(node) || checkGrammarForBodyInAmbientContext(node.body, /*isConstructor:*/ true); + checkSignatureDeclaration(node); checkSourceElement(node.body); @@ -8244,7 +8246,7 @@ module ts { function checkThrowStatement(node: ThrowStatement) { if (node.expression === undefined) { - grammarErrorAfterFirstToken(getSourceFileOfNode(node), node, Diagnostics.Line_break_not_permitted_here); + grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); } if (node.expression) { @@ -10481,7 +10483,29 @@ module ts { } } - function grammarErrorAfterFirstToken(sourceFile: SourceFile, node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + function checkGrammarConstructorTypeParameters(node: ConstructorDeclaration) { + if (node.typeParameters) { + return grammarErrorAtPos(getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + + function checkGrammarConstructorTypeAnnotation(node: ConstructorDeclaration) { + if (node.type) { + return grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + + function checkGrammarForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { + if (isInAmbientContext(body) && body && body.kind === SyntaxKind.Block) { + var diagnostic = isConstructor + ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context + : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + + function grammarErrorAfterFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { var scanner = createScanner(compilerOptions.target, /*skipTrivia*/ true, sourceFile.text); scanToken(scanner, node.pos); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index c823469c7a0..6feeedc159c 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4639,7 +4639,7 @@ module ts { //case SyntaxKind.CatchClause: return checkCatchClause(node); //case SyntaxKind.ClassDeclaration: return checkClassDeclaration(node); //case SyntaxKind.ComputedPropertyName: return checkComputedPropertyName(node); - case SyntaxKind.Constructor: return checkConstructor(node); + //case SyntaxKind.Constructor: return checkConstructor(node); //case SyntaxKind.DeleteExpression: return checkDeleteExpression( node); //case SyntaxKind.ElementAccessExpression: return checkElementAccessExpression(node); //case SyntaxKind.ExportAssignment: return checkExportAssignment(node); @@ -5323,7 +5323,7 @@ module ts { switch (node.kind) { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: + //case SyntaxKind.Constructor: case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: case SyntaxKind.MethodDeclaration: @@ -5331,7 +5331,7 @@ module ts { //case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: + //case SyntaxKind.EnumDeclaration: case SyntaxKind.ExportAssignment: case SyntaxKind.VariableStatement: case SyntaxKind.FunctionDeclaration: diff --git a/tests/baselines/reference/emptyGenericParamList.errors.txt b/tests/baselines/reference/emptyGenericParamList.errors.txt index 361e5a2fc21..ed1046d0f49 100644 --- a/tests/baselines/reference/emptyGenericParamList.errors.txt +++ b/tests/baselines/reference/emptyGenericParamList.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. tests/cases/compiler/emptyGenericParamList.ts(2,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. ==== tests/cases/compiler/emptyGenericParamList.ts (2 errors) ==== class I {} var x: I<>; - ~~ -!!! error TS1099: Type argument list cannot be empty. ~~~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'I' requires 1 type argument(s). + ~~ +!!! error TS1099: Type argument list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt index 6ec975e33ea..4775ec0511b 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(8,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(3,9): error TS7008: Member 'publicMember' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,9): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,31): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(8,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. ==== tests/cases/compiler/implicitAnyInAmbientDeclaration.ts (4 errors) ==== diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt index 726c408aced..260dc6c9899 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(9,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,1): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,22): error TS7006: Parameter 'x' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(2,13): error TS7005: Variable 'bar' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(4,5): error TS7008: Member 'publicMember' implicitly has an 'any' type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,5): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,27): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(9,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(13,24): error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type. diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt index 09647b56771..0d2ef3d6924 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt @@ -1,24 +1,24 @@ tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(13,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(19,5): error TS1044: 'public' modifier cannot appear on a module element. -tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(25,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(38,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(44,5): error TS1044: 'private' modifier cannot appear on a module element. -tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(50,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(64,5): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(70,5): error TS1044: 'static' modifier cannot appear on a module element. -tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(4,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(6,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(12,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(15,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(25,5): error TS1044: 'public' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(29,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(31,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(37,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(40,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(50,5): error TS1044: 'private' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(55,5): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(57,5): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(63,5): error TS1044: 'static' modifier cannot appear on a module element. tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(66,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier cannot appear on a module element. ==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts (21 errors) ==== diff --git a/tests/baselines/reference/parserComputedPropertyName34.errors.txt b/tests/baselines/reference/parserComputedPropertyName34.errors.txt index 05d7375f132..9b244a5a13a 100644 --- a/tests/baselines/reference/parserComputedPropertyName34.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName34.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(3,5): error TS1164: Computed property names are not allowed in enums. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(4,5): error TS1164: Computed property names are not allowed in enums. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(3,11): error TS2304: Cannot find name 'id'. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(4,5): error TS1164: Computed property names are not allowed in enums. ==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts (3 errors) ==== diff --git a/tests/baselines/reference/parserConstructorDeclaration12.errors.txt b/tests/baselines/reference/parserConstructorDeclaration12.errors.txt index 949098e91da..181a3b2215f 100644 --- a/tests/baselines/reference/parserConstructorDeclaration12.errors.txt +++ b/tests/baselines/reference/parserConstructorDeclaration12.errors.txt @@ -1,61 +1,61 @@ -tests/cases/compiler/parserConstructorDeclaration12.ts(2,14): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(3,14): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(4,15): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(5,15): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(6,14): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(7,14): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(8,15): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/parserConstructorDeclaration12.ts(9,15): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(2,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(2,14): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(3,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(3,14): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(4,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(4,15): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(5,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(5,15): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(6,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(6,14): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(7,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(7,14): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(8,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(8,15): error TS1098: Type parameter list cannot be empty. tests/cases/compiler/parserConstructorDeclaration12.ts(9,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(9,15): error TS1098: Type parameter list cannot be empty. ==== tests/cases/compiler/parserConstructorDeclaration12.ts (16 errors) ==== class C { constructor<>() { } - ~~ -!!! error TS1098: Type parameter list cannot be empty. ~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. - constructor<> () { } ~~ !!! error TS1098: Type parameter list cannot be empty. + constructor<> () { } ~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. + ~~ +!!! error TS1098: Type parameter list cannot be empty. constructor <>() { } - ~~ -!!! error TS1098: Type parameter list cannot be empty. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. + ~~ +!!! error TS1098: Type parameter list cannot be empty. constructor <> () { } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. ~~ !!! error TS1098: Type parameter list cannot be empty. - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2392: Multiple constructor implementations are not allowed. constructor< >() { } - ~~~ -!!! error TS1098: Type parameter list cannot be empty. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. - constructor< > () { } ~~~ !!! error TS1098: Type parameter list cannot be empty. + constructor< > () { } ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. + ~~~ +!!! error TS1098: Type parameter list cannot be empty. constructor < >() { } - ~~~ -!!! error TS1098: Type parameter list cannot be empty. ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. - constructor < > () { } ~~~ !!! error TS1098: Type parameter list cannot be empty. + constructor < > () { } ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2392: Multiple constructor implementations are not allowed. + ~~~ +!!! error TS1098: Type parameter list cannot be empty. } \ No newline at end of file diff --git a/tests/baselines/reference/protectedMembers.errors.txt b/tests/baselines/reference/protectedMembers.errors.txt index 10ea00cf10f..c35bc25fe71 100644 --- a/tests/baselines/reference/protectedMembers.errors.txt +++ b/tests/baselines/reference/protectedMembers.errors.txt @@ -1,4 +1,3 @@ -tests/cases/compiler/protectedMembers.ts(86,5): error TS1089: 'protected' modifier cannot appear on a constructor declaration. tests/cases/compiler/protectedMembers.ts(40,1): error TS2445: Property 'x' is protected and only accessible within class 'C1' and its subclasses. tests/cases/compiler/protectedMembers.ts(41,1): error TS2445: Property 'f' is protected and only accessible within class 'C1' and its subclasses. tests/cases/compiler/protectedMembers.ts(42,1): error TS2445: Property 'sx' is protected and only accessible within class 'C1' and its subclasses. @@ -9,6 +8,7 @@ tests/cases/compiler/protectedMembers.ts(48,1): error TS2445: Property 'sx' is p tests/cases/compiler/protectedMembers.ts(49,1): error TS2445: Property 'sf' is protected and only accessible within class 'C2' and its subclasses. tests/cases/compiler/protectedMembers.ts(68,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. tests/cases/compiler/protectedMembers.ts(69,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. +tests/cases/compiler/protectedMembers.ts(86,5): error TS1089: 'protected' modifier cannot appear on a constructor declaration. tests/cases/compiler/protectedMembers.ts(98,1): error TS2322: Type 'B1' is not assignable to type 'A1'. Property 'x' is protected but type 'B1' is not a class derived from 'A1'. tests/cases/compiler/protectedMembers.ts(99,1): error TS2322: Type 'A1' is not assignable to type 'B1'. diff --git a/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt index 45f860bc9a3..9106cdb6151 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt +++ b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,42): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,42): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts (2 errors) ==== `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` - ~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + ~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt index 010831effe8..2440e51cd39 100644 --- a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(4,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. +tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(11,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(12,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. -tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target.