From 0482b6174d69ff89793b9e06370ac9b601fb3ba0 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Thu, 9 Aug 2018 20:41:47 +0200 Subject: [PATCH] error on set accessor without get accessor Fixes: #11596 --- src/compiler/checker.ts | 3 + src/compiler/diagnosticMessages.json | 4 + .../MemberAccessorDeclaration15.errors.txt | 5 +- .../accessibilityModifiers.errors.txt | 23 +- ...rParameterAccessibilityModifier.errors.txt | 8 +- .../reference/accessorWithES3.errors.txt | 8 +- .../reference/accessorWithES5.errors.txt | 27 + .../accessorWithInitializer.errors.txt | 8 +- .../accessorWithRestParam.errors.txt | 8 +- .../reference/accessorWithoutBody2.errors.txt | 5 +- .../reference/asyncSetter_es5.errors.txt | 5 +- .../reference/asyncSetter_es6.errors.txt | 5 +- .../classAbstractAccessor.errors.txt | 8 +- .../cloduleWithDuplicateMember2.errors.txt | 8 +- ...deGenModuleWithAccessorChildren.errors.txt | 11 +- .../collisionSuperAndParameter.errors.txt | 71 + .../reference/commentsClassMembers.errors.txt | 226 +++ .../computedPropertyNames11_ES5.errors.txt | 22 + .../computedPropertyNames11_ES6.errors.txt | 22 + .../computedPropertyNames16_ES5.errors.txt | 22 + .../computedPropertyNames16_ES6.errors.txt | 22 + .../computedPropertyNames36_ES5.errors.txt | 5 +- .../computedPropertyNames36_ES6.errors.txt | 5 +- .../computedPropertyNames37_ES5.errors.txt | 16 + .../computedPropertyNames37_ES6.errors.txt | 16 + .../computedPropertyNames43_ES5.errors.txt | 5 +- .../computedPropertyNames43_ES6.errors.txt | 5 +- .../computedPropertyNames44_ES5.errors.txt | 5 +- .../computedPropertyNames44_ES6.errors.txt | 5 +- .../computedPropertyNames45_ES5.errors.txt | 5 +- .../computedPropertyNames45_ES6.errors.txt | 5 +- .../reference/declFileAccessors.errors.txt | 107 ++ ...FileObjectLiteralWithOnlySetter.errors.txt | 14 + .../declFilePrivateStatic.errors.txt | 22 + ...otationVisibilityErrorAccessors.errors.txt | 111 ++ ...tionEmitClassMemberNameConflict.errors.txt | 41 + ...declarationEmitProtectedMembers.errors.txt | 55 + .../decoratorOnClassAccessor4.errors.txt | 11 + .../decoratorOnClassAccessor5.errors.txt | 11 + .../decoratorOnClassAccessor6.errors.txt | 5 +- .../decoratorOnClassAccessor8.errors.txt | 35 + ...ClassOverridesProtectedMembers3.errors.txt | 8 +- .../reference/downlevelLetConst18.errors.txt | 5 +- .../duplicateClassElements.errors.txt | 8 +- .../reference/dynamicNamesErrors.errors.txt | 11 +- ...eclarationWithGetterSetterInES6.errors.txt | 42 + ...DeclarationWithThisKeywordInES6.errors.txt | 24 + ...ithTypeArgumentAndOverloadInES6.errors.txt | 28 + ...eclarationWithTypeArgumentInES6.errors.txt | 20 + .../errorsInGenericTypeReference.errors.txt | 5 +- ...parameterDestructuringNotElided.errors.txt | 12 + .../reference/es6ClassTest2.errors.txt | 5 +- ...rtEqualsClassRedeclarationError.errors.txt | 5 +- ...rtsWithContextualKeywordNames01.errors.txt | 5 +- .../getAndSetAsMemberNames.errors.txt | 5 +- tests/baselines/reference/giant.errors.txt | 83 +- ...AndSetAccessorWithAnyReturnType.errors.txt | 5 +- .../interfaceImplementation5.errors.txt | 8 +- .../reference/invalidNewTarget.es5.errors.txt | 11 +- .../reference/invalidNewTarget.es6.errors.txt | 11 +- .../isDeclarationVisibleNodeKinds.errors.txt | 74 + ...noImplicitAnyMissingGetAccessor.errors.txt | 8 +- .../objectLiteralErrorsES3.errors.txt | 5 +- .../objectLiteralGettersAndSetters.errors.txt | 8 +- ...tiesErrorFromNotUsingIdentifier.errors.txt | 5 +- .../baselines/reference/objectRest.errors.txt | 53 + .../reference/objectRestParameter.errors.txt | 27 + .../objectRestParameterES5.errors.txt | 27 + .../reference/objectSpreadNegative.errors.txt | 5 +- .../reference/optionalSetterParam.errors.txt | 5 +- .../reference/parserAccessors2.errors.txt | 9 + .../reference/parserAccessors4.errors.txt | 7 + .../reference/parserAccessors6.errors.txt | 5 +- .../reference/parserAccessors8.errors.txt | 7 +- .../reference/parserAccessors9.errors.txt | 7 +- .../reference/parserES3Accessors2.errors.txt | 5 +- .../reference/parserES3Accessors4.errors.txt | 5 +- ...rserMemberAccessorDeclaration13.errors.txt | 5 +- ...rserMemberAccessorDeclaration14.errors.txt | 5 +- ...rserMemberAccessorDeclaration15.errors.txt | 5 +- ...rserMemberAccessorDeclaration16.errors.txt | 5 +- ...rserMemberAccessorDeclaration17.errors.txt | 5 +- ...rserMemberAccessorDeclaration18.errors.txt | 5 +- ...arserMemberAccessorDeclaration4.errors.txt | 9 + ...arserMemberAccessorDeclaration5.errors.txt | 9 + ...arserMemberAccessorDeclaration6.errors.txt | 9 + ...rSetAccessorWithTypeAnnotation1.errors.txt | 5 +- ...rSetAccessorWithTypeParameters1.errors.txt | 5 +- .../reference/parserStrictMode12.errors.txt | 5 +- .../privacyAccessorDeclFile.errors.txt | 1371 +++++++++++++++++ .../reference/privacyAccessorDeclFile.js | 271 ---- ...propertyAndAccessorWithSameName.errors.txt | 8 +- ...readonlyInNonPropertyParameters.errors.txt | 5 +- .../reference/recursiveProperties.errors.txt | 13 + ...rsiveSpecializationOfSignatures.errors.txt | 5 +- .../reference/returnValueInSetter.errors.txt | 5 +- .../reference/setterWithReturn.errors.txt | 5 +- .../superPropertyAccess_ES5.errors.txt | 5 +- .../superPropertyAccess_ES6.errors.txt | 34 + .../symbolDeclarationEmit12.errors.txt | 5 +- .../symbolDeclarationEmit13.errors.txt | 10 + .../reference/symbolProperty18.errors.txt | 15 + ...nFunctionParametersAndArguments.errors.txt | 5 +- ...ransformsElideNullUndefinedType.errors.txt | 67 + .../twoAccessorsWithSameName.errors.txt | 8 +- .../twoAccessorsWithSameName2.errors.txt | 8 +- .../typeGuardFunctionErrors.errors.txt | 5 +- ...typeParametersInStaticAccessors.errors.txt | 5 +- .../reference/uniqueSymbolsErrors.errors.txt | 8 +- .../unusedLocalsAndParameters.errors.txt | 11 +- ...usedLocalsAndParametersDeferred.errors.txt | 11 +- .../reference/unusedPrivateMembers.errors.txt | 54 + .../reference/unusedSetterInClass.errors.txt | 5 +- .../reference/unusedSetterInClass2.errors.txt | 5 +- 114 files changed, 3239 insertions(+), 345 deletions(-) create mode 100644 tests/baselines/reference/accessorWithES5.errors.txt create mode 100644 tests/baselines/reference/collisionSuperAndParameter.errors.txt create mode 100644 tests/baselines/reference/commentsClassMembers.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames11_ES5.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames11_ES6.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames16_ES5.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames16_ES6.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames37_ES5.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames37_ES6.errors.txt create mode 100644 tests/baselines/reference/declFileAccessors.errors.txt create mode 100644 tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt create mode 100644 tests/baselines/reference/declFilePrivateStatic.errors.txt create mode 100644 tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt create mode 100644 tests/baselines/reference/declarationEmitClassMemberNameConflict.errors.txt create mode 100644 tests/baselines/reference/declarationEmitProtectedMembers.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassAccessor4.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassAccessor5.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassAccessor8.errors.txt create mode 100644 tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.errors.txt create mode 100644 tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.errors.txt create mode 100644 tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.errors.txt create mode 100644 tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.errors.txt create mode 100644 tests/baselines/reference/es5SetterparameterDestructuringNotElided.errors.txt create mode 100644 tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt create mode 100644 tests/baselines/reference/objectRest.errors.txt create mode 100644 tests/baselines/reference/objectRestParameter.errors.txt create mode 100644 tests/baselines/reference/objectRestParameterES5.errors.txt create mode 100644 tests/baselines/reference/parserAccessors2.errors.txt create mode 100644 tests/baselines/reference/parserAccessors4.errors.txt create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt create mode 100644 tests/baselines/reference/privacyAccessorDeclFile.errors.txt create mode 100644 tests/baselines/reference/recursiveProperties.errors.txt create mode 100644 tests/baselines/reference/superPropertyAccess_ES6.errors.txt create mode 100644 tests/baselines/reference/symbolDeclarationEmit13.errors.txt create mode 100644 tests/baselines/reference/symbolProperty18.errors.txt create mode 100644 tests/baselines/reference/transformsElideNullUndefinedType.errors.txt create mode 100644 tests/baselines/reference/unusedPrivateMembers.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2b01649132ea0..09fb4ad5961f4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22563,6 +22563,9 @@ namespace ts { checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, Diagnostics.get_and_set_accessor_must_have_the_same_type); checkAccessorDeclarationTypesIdentical(node, otherAccessor, getThisTypeOfDeclaration, Diagnostics.get_and_set_accessor_must_have_the_same_this_type); } + else if (node.kind === SyntaxKind.SetAccessor) { + error(node.name, Diagnostics.A_set_accessor_must_have_a_corresponding_get_accessor); + } } const returnType = getTypeOfAccessors(getSymbolOfNode(node)); if (node.kind === SyntaxKind.GetAccessor) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5d4d9ae701d38..f9b0446f268d0 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -155,6 +155,10 @@ "category": "Error", "code": 1049 }, + "A 'set' accessor must have a corresponding 'get' accessor.": { + "category": "Error", + "code": 1050 + }, "A 'set' accessor cannot have an optional parameter.": { "category": "Error", "code": 1051 diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt index 6ed8a2d29cdbe..289251ad1f4b6 100644 --- a/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt +++ b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt @@ -1,11 +1,14 @@ +tests/cases/compiler/MemberAccessorDeclaration15.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/MemberAccessorDeclaration15.ts(2,8): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/MemberAccessorDeclaration15.ts(2,12): error TS2369: A parameter property is only allowed in a constructor implementation. -==== tests/cases/compiler/MemberAccessorDeclaration15.ts (2 errors) ==== +==== tests/cases/compiler/MemberAccessorDeclaration15.ts (3 errors) ==== class C { set Foo(public a: number) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. diff --git a/tests/baselines/reference/accessibilityModifiers.errors.txt b/tests/baselines/reference/accessibilityModifiers.errors.txt index 7d4351bd7b6b4..39d6be2368eda 100644 --- a/tests/baselines/reference/accessibilityModifiers.errors.txt +++ b/tests/baselines/reference/accessibilityModifiers.errors.txt @@ -1,38 +1,51 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(6,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(11,26): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(16,23): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(21,12): error TS1029: 'private' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(22,12): error TS1029: 'private' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(23,12): error TS1029: 'private' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(24,12): error TS1029: 'private' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(24,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(26,12): error TS1029: 'protected' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(27,12): error TS1029: 'protected' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(28,12): error TS1029: 'protected' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(29,12): error TS1029: 'protected' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(29,26): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(31,12): error TS1029: 'public' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(32,12): error TS1029: 'public' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(33,12): error TS1029: 'public' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(34,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(34,23): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(39,13): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,12): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(41,13): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,12): error TS1028: Accessibility modifier already seen. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,23): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (16 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (23 errors) ==== // No errors class C { private static privateProperty; private static privateMethod() { } private static get privateGetter() { return 0; } private static set privateSetter(a: number) { } + ~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. protected static protectedProperty; protected static protectedMethod() { } protected static get protectedGetter() { return 0; } protected static set protectedSetter(a: number) { } + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. public static publicProperty; public static publicMethod() { } public static get publicGetter() { return 0; } public static set publicSetter(a: number) { } + ~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } // Errors, accessibility modifiers must precede static @@ -49,6 +62,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier static private set privateSetter(a: number) { } ~~~~~~~ !!! error TS1029: 'private' modifier must precede 'static' modifier. + ~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. static protected protectedProperty; ~~~~~~~~~ @@ -62,6 +77,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier static protected set protectedSetter(a: number) { } ~~~~~~~~~ !!! error TS1029: 'protected' modifier must precede 'static' modifier. + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. static public publicProperty; ~~~~~~ @@ -75,6 +92,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier static public set publicSetter(a: number) { } ~~~~~~ !!! error TS1029: 'public' modifier must precede 'static' modifier. + ~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } // Errors, multiple accessibility modifier @@ -91,5 +110,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier public public set setter(a: number) { } ~~~~~~ !!! error TS1028: Accessibility modifier already seen. + ~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt index 17216739372f9..1b2ffcc6b139e 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorParameterAccessibilityModifier.ts(2,11): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,18): error TS2369: A parameter property is only allowed in a constructor implementation. -==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (2 errors) ==== +==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (4 errors) ==== class C { set X(public v) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. static set X(public v2) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES3.errors.txt b/tests/baselines/reference/accessorWithES3.errors.txt index 0a2219d85a463..4e8dff928502c 100644 --- a/tests/baselines/reference/accessorWithES3.errors.txt +++ b/tests/baselines/reference/accessorWithES3.errors.txt @@ -1,10 +1,12 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(19,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (6 errors) ==== // error to use accessors in ES3 mode class C { @@ -18,6 +20,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclara class D { set x(v) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } @@ -31,5 +35,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclara var y = { set b(v) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES5.errors.txt b/tests/baselines/reference/accessorWithES5.errors.txt new file mode 100644 index 0000000000000..06c8ca19d30b8 --- /dev/null +++ b/tests/baselines/reference/accessorWithES5.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts(8,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts(17,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts (2 errors) ==== + class C { + get x() { + return 1; + } + } + + class D { + set x(v) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + var x = { + get a() { return 1 } + } + + var y = { + set b(v) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithInitializer.errors.txt b/tests/baselines/reference/accessorWithInitializer.errors.txt index 1e64be49a1e66..e00e42117b709 100644 --- a/tests/baselines/reference/accessorWithInitializer.errors.txt +++ b/tests/baselines/reference/accessorWithInitializer.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/accessorWithInitializer.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorWithInitializer.ts(2,9): error TS1052: A 'set' accessor parameter cannot have an initializer. +tests/cases/compiler/accessorWithInitializer.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorWithInitializer.ts(3,16): error TS1052: A 'set' accessor parameter cannot have an initializer. -==== tests/cases/compiler/accessorWithInitializer.ts (2 errors) ==== +==== tests/cases/compiler/accessorWithInitializer.ts (4 errors) ==== class C { set X(v = 0) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1052: A 'set' accessor parameter cannot have an initializer. static set X(v2 = 0) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1052: A 'set' accessor parameter cannot have an initializer. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithRestParam.errors.txt b/tests/baselines/reference/accessorWithRestParam.errors.txt index ae06df99c95ed..357d87cc6dcda 100644 --- a/tests/baselines/reference/accessorWithRestParam.errors.txt +++ b/tests/baselines/reference/accessorWithRestParam.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/accessorWithRestParam.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorWithRestParam.ts(2,11): error TS1053: A 'set' accessor cannot have rest parameter. +tests/cases/compiler/accessorWithRestParam.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorWithRestParam.ts(3,18): error TS1053: A 'set' accessor cannot have rest parameter. -==== tests/cases/compiler/accessorWithRestParam.ts (2 errors) ==== +==== tests/cases/compiler/accessorWithRestParam.ts (4 errors) ==== class C { set X(...v) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~ !!! error TS1053: A 'set' accessor cannot have rest parameter. static set X(...v2) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~ !!! error TS1053: A 'set' accessor cannot have rest parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithoutBody2.errors.txt b/tests/baselines/reference/accessorWithoutBody2.errors.txt index 41bec9390450c..f90b017051f73 100644 --- a/tests/baselines/reference/accessorWithoutBody2.errors.txt +++ b/tests/baselines/reference/accessorWithoutBody2.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/accessorWithoutBody2.ts(1,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/accessorWithoutBody2.ts(1,20): error TS1005: '{' expected. -==== tests/cases/compiler/accessorWithoutBody2.ts (1 errors) ==== +==== tests/cases/compiler/accessorWithoutBody2.ts (2 errors) ==== var v = { set foo(a) } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS1005: '{' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncSetter_es5.errors.txt b/tests/baselines/reference/asyncSetter_es5.errors.txt index 59557ec9313fc..f9ad5b392e430 100644 --- a/tests/baselines/reference/asyncSetter_es5.errors.txt +++ b/tests/baselines/reference/asyncSetter_es5.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/async/es5/asyncSetter_es5.ts(2,3): error TS1042: 'async' modifier cannot be used here. +tests/cases/conformance/async/es5/asyncSetter_es5.ts(2,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/async/es5/asyncSetter_es5.ts (1 errors) ==== +==== tests/cases/conformance/async/es5/asyncSetter_es5.ts (2 errors) ==== class C { async set foo(value) { ~~~~~ !!! error TS1042: 'async' modifier cannot be used here. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } } \ No newline at end of file diff --git a/tests/baselines/reference/asyncSetter_es6.errors.txt b/tests/baselines/reference/asyncSetter_es6.errors.txt index e60e05cbc550e..c01991a0ee2b0 100644 --- a/tests/baselines/reference/asyncSetter_es6.errors.txt +++ b/tests/baselines/reference/asyncSetter_es6.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/async/es6/asyncSetter_es6.ts(2,3): error TS1042: 'async' modifier cannot be used here. +tests/cases/conformance/async/es6/asyncSetter_es6.ts(2,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/async/es6/asyncSetter_es6.ts (1 errors) ==== +==== tests/cases/conformance/async/es6/asyncSetter_es6.ts (2 errors) ==== class C { async set foo(value) { ~~~~~ !!! error TS1042: 'async' modifier cannot be used here. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } } \ No newline at end of file diff --git a/tests/baselines/reference/classAbstractAccessor.errors.txt b/tests/baselines/reference/classAbstractAccessor.errors.txt index 9afc61fb5fbe1..373f6de213578 100644 --- a/tests/baselines/reference/classAbstractAccessor.errors.txt +++ b/tests/baselines/reference/classAbstractAccessor.errors.txt @@ -1,16 +1,22 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts(3,17): error TS1318: An abstract accessor cannot have an implementation. +tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts(4,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts(5,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts(5,17): error TS1318: An abstract accessor cannot have an implementation. -==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts (2 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts (4 errors) ==== abstract class A { abstract get a(); abstract get aa() { return 1; } // error ~~ !!! error TS1318: An abstract accessor cannot have an implementation. abstract set b(x: string); + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. abstract set bb(x: string) {} // error ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~ !!! error TS1318: An abstract accessor cannot have an implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt index 55d2fdbddf26c..3b469de3e5bec 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt @@ -1,16 +1,22 @@ +tests/cases/compiler/cloduleWithDuplicateMember2.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/cloduleWithDuplicateMember2.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/cloduleWithDuplicateMember2.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/cloduleWithDuplicateMember2.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/cloduleWithDuplicateMember2.ts(7,16): error TS2300: Duplicate identifier 'x'. tests/cases/compiler/cloduleWithDuplicateMember2.ts(10,21): error TS2300: Duplicate identifier 'x'. -==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (4 errors) ==== +==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (6 errors) ==== class C { set x(y) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set y(z) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt index 9ba074a1cae23..2fe2b55880b16 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt @@ -1,17 +1,22 @@ +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(5,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(14,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(14,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(24,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(24,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(32,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(41,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts (5 errors) ==== +==== tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts (8 errors) ==== module M { export var x = 3; class c { private y; set Z(M) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.y = x; } @@ -23,6 +28,8 @@ tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(41,13): error private y; set Z(p) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var M = 10; this.y = x; @@ -35,6 +42,8 @@ tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(41,13): error private y; set M(p) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.y = x; } diff --git a/tests/baselines/reference/collisionSuperAndParameter.errors.txt b/tests/baselines/reference/collisionSuperAndParameter.errors.txt new file mode 100644 index 0000000000000..774caf7b9a07a --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndParameter.errors.txt @@ -0,0 +1,71 @@ +tests/cases/compiler/collisionSuperAndParameter.ts(12,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/collisionSuperAndParameter.ts(26,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/collisionSuperAndParameter.ts (2 errors) ==== + class Foo { + a() { + var lamda = (_super: number) => { // No Error + return x => this; // New scope. So should inject new _this capture + } + } + b(_super: number) { // No Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + set c(_super: number) { // No error + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + class Foo2 extends Foo { + x() { + var lamda = (_super: number) => { // Error + return x => this; // New scope. So should inject new _this capture + } + } + y(_super: number) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + set z(_super: number) { // Error + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + public prop3: { + doStuff: (_super: number) => void; // no error - no code gen + } + public prop4 = { + doStuff: (_super: number) => { // should be error + } + } + constructor(_super: number) { // should be error + super(); + } + } + declare class Foo3 extends Foo { + x(); + y(_super: number); // No error - no code gen + constructor(_super: number); // No error - no code gen + public prop2: { + doStuff: (_super: number) => void; // no error - no code gen + }; + public _super: number; // No error + } + + class Foo4 extends Foo { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(_super: any) { // should be error + super(); + } + y(_super: number); // no code gen - no error + y(_super: string); // no code gen - no error + y(_super: any) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsClassMembers.errors.txt b/tests/baselines/reference/commentsClassMembers.errors.txt new file mode 100644 index 0000000000000..351f875d6d569 --- /dev/null +++ b/tests/baselines/reference/commentsClassMembers.errors.txt @@ -0,0 +1,226 @@ +tests/cases/compiler/commentsClassMembers.ts(204,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/commentsClassMembers.ts(207,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/commentsClassMembers.ts (2 errors) ==== + /** This is comment for c1*/ + class c1 { + /** p1 is property of c1*/ + public p1: number; + /** sum with property*/ + public p2(/** number to add*/b: number) { + return this.p1 + b; + } /* trailing comment of method*/ + /** getter property*/ + public get p3() { + return this.p2(this.p1); + }// trailing comment Getter + /** setter property*/ + public set p3(/** this is value*/value: number) { + this.p1 = this.p2(value); + }// trailing comment Setter + /** pp1 is property of c1*/ + private pp1: number; + /** sum with property*/ + private pp2(/** number to add*/b: number) { + return this.p1 + b; + } // trailing comment of method + /** getter property*/ + private get pp3() { + return this.pp2(this.pp1); + } + /** setter property*/ + private set pp3( /** this is value*/value: number) { + this.pp1 = this.pp2(value); + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; + /** static sum with property*/ + static s2(/** number to add*/b: number) { + return c1.s1 + b; + } + /** static getter property*/ + static get s3() { + return c1.s2(c1.s1); + } /*trailing comment 1 getter*/ + /** setter property*/ + static set s3( /** this is value*/value: number) { + c1.s1 = c1.s2(value); + }/*trailing comment 2 */ /*setter*/ + public nc_p1: number; + public nc_p2(b: number) { + return this.nc_p1 + b; + } + public get nc_p3() { + return this.nc_p2(this.nc_p1); + } + public set nc_p3(value: number) { + this.nc_p1 = this.nc_p2(value); + } + private nc_pp1: number; + private nc_pp2(b: number) { + return this.nc_pp1 + b; + } + private get nc_pp3() { + return this.nc_pp2(this.nc_pp1); + } + private set nc_pp3(value: number) { + this.nc_pp1 = this.nc_pp2(value); + } + static nc_s1: number; + static nc_s2(b: number) { + return c1.nc_s1 + b; + } + static get nc_s3() { + return c1.nc_s2(c1.nc_s1); + } + static set nc_s3(value: number) { + c1.nc_s1 = c1.nc_s2(value); + } + + // p1 is property of c1 + public a_p1: number; + // sum with property + public a_p2(b: number) { + return this.a_p1 + b; + } + // getter property + public get a_p3() { + return this.a_p2(this.a_p1); + } + // setter property + public set a_p3(value: number) { + this.a_p1 = this.a_p2(value); + } + // pp1 is property of c1 + private a_pp1: number; + // sum with property + private a_pp2(b: number) { + return this.a_p1 + b; + } + // getter property + private get a_pp3() { + return this.a_pp2(this.a_pp1); + } + // setter property + private set a_pp3(value: number) { + this.a_pp1 = this.a_pp2(value); + } + + // s1 is static property of c1 + static a_s1: number; + // static sum with property + static a_s2(b: number) { + return c1.a_s1 + b; + } + // static getter property + static get a_s3() { + return c1.s2(c1.s1); + } + + // setter property + static set a_s3(value: number) { + c1.a_s1 = c1.a_s2(value); + } + + /** p1 is property of c1 */ + public b_p1: number; + /** sum with property */ + public b_p2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + public get b_p3() { + return this.b_p2(this.b_p1); + } + /** setter property */ + public set b_p3(value: number) { + this.b_p1 = this.b_p2(value); + } + /** pp1 is property of c1 */ + private b_pp1: number; + /** sum with property */ + private b_pp2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + private get b_pp3() { + return this.b_pp2(this.b_pp1); + } + /** setter property */ + private set b_pp3(value: number) { + this.b_pp1 = this.b_pp2(value); + } + + /** s1 is static property of c1 */ + static b_s1: number; + /** static sum with property */ + static b_s2(b: number) { + return c1.b_s1 + b; + } + /** static getter property + */ + static get b_s3() { + return c1.s2(c1.s1); + } + + /** setter property + */ + static set b_s3(value: number) { + /** setter */ + c1.b_s1 = c1.b_s2(value); + } + } + var i1 = new c1(); + var i1_p = i1.p1; + var i1_f = i1.p2; + var i1_r = i1.p2(20); + var i1_prop = i1.p3; + i1.p3 = i1_prop; + var i1_nc_p = i1.nc_p1; + var i1_ncf = i1.nc_p2; + var i1_ncr = i1.nc_p2(20); + var i1_ncprop = i1.nc_p3; + i1.nc_p3 = i1_ncprop; + var i1_s_p = c1.s1; + var i1_s_f = c1.s2; + var i1_s_r = c1.s2(20); + var i1_s_prop = c1.s3; + c1.s3 = i1_s_prop; + var i1_s_nc_p = c1.nc_s1; + var i1_s_ncf = c1.nc_s2; + var i1_s_ncr = c1.nc_s2(20); + var i1_s_ncprop = c1.nc_s3; + c1.nc_s3 = i1_s_ncprop; + var i1_c = c1; + class cProperties { + private val: number; + /** getter only property*/ + public get p1() { + return this.val; + } // trailing comment of only getter + public get nc_p1() { + return this.val; + } + /**setter only property*/ + public set p2(value: number) { + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + this.val = value; + } + public set nc_p2(value: number) { + ~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + this.val = value; + } /* trailing comment of setter only*/ + + public x = 10; /*trailing comment for property*/ + private y = 10; // trailing comment of // style + } + var cProperties_i = new cProperties(); + cProperties_i.p2 = cProperties_i.p1; + cProperties_i.nc_p2 = cProperties_i.nc_p1; + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames11_ES5.errors.txt new file mode 100644 index 0000000000000..19fdc3bc6389f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES5.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts (1 errors) ==== + var s: string; + var n: number; + var a: any; + var v = { + get [s]() { return 0; }, + set [n](v) { }, + get [s + s]() { return 0; }, + set [s + n](v) { }, + get [+s]() { return 0; }, + set [""](v) { }, + ~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + get [0]() { return 0; }, + set [a](v) { }, + get [true]() { return 0; }, + set [`hello bye`](v) { }, + get [`hello ${a} bye`]() { return 0; } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames11_ES6.errors.txt new file mode 100644 index 0000000000000..791a0aa76887a --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES6.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES6.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES6.ts (1 errors) ==== + var s: string; + var n: number; + var a: any; + var v = { + get [s]() { return 0; }, + set [n](v) { }, + get [s + s]() { return 0; }, + set [s + n](v) { }, + get [+s]() { return 0; }, + set [""](v) { }, + ~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + get [0]() { return 0; }, + set [a](v) { }, + get [true]() { return 0; }, + set [`hello bye`](v) { }, + get [`hello ${a} bye`]() { return 0; } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames16_ES5.errors.txt new file mode 100644 index 0000000000000..8686cdd0c2fdb --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES5.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(10,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts (1 errors) ==== + var s: string; + var n: number; + var a: any; + class C { + get [s]() { return 0;} + set [n](v) { } + static get [s + s]() { return 0; } + set [s + n](v) { } + get [+s]() { return 0; } + static set [""](v) { } + ~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + get [0]() { return 0; } + set [a](v) { } + static get [true]() { return 0; } + set [`hello bye`](v) { } + get [`hello ${a} bye`]() { return 0; } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames16_ES6.errors.txt new file mode 100644 index 0000000000000..ed81593470876 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES6.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES6.ts(10,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES6.ts (1 errors) ==== + var s: string; + var n: number; + var a: any; + class C { + get [s]() { return 0;} + set [n](v) { } + static get [s + s]() { return 0; } + set [s + n](v) { } + get [+s]() { return 0; } + static set [""](v) { } + ~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + get [0]() { return 0; } + set [a](v) { } + static get [true]() { return 0; } + set [`hello bye`](v) { } + get [`hello ${a} bye`]() { return 0; } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt index 506a9ca15d157..0dfe67003f656 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(9,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } @@ -13,4 +14,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8, ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt index cf50807ac5403..fb59a7def63f7 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(9,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } @@ -13,4 +14,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8, ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames37_ES5.errors.txt new file mode 100644 index 0000000000000..0ff51dd70dbc7 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES5.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts(9,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts (1 errors) ==== + class Foo { x } + class Foo2 { x; y } + + class C { + [s: number]: Foo2; + + // Computed properties + get ["get1"]() { return new Foo } + set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames37_ES6.errors.txt new file mode 100644 index 0000000000000..a6f54ba42e9d1 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES6.ts(9,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES6.ts (1 errors) ==== + class Foo { x } + class Foo2 { x; y } + + class C { + [s: number]: Foo2; + + // Computed properties + get ["get1"]() { return new Foo } + set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt index d777ae659defd..bb40645669f8a 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(11,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } @@ -15,4 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10 ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt index 6af43ebfa5cb3..6f9ef33e0259b 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(11,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } @@ -15,4 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10 ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt index 43801ab3d627b..5142e30101471 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -16,5 +17,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10 class D extends C { set ["set1"](p: Foo) { } ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt index 28b861347a37e..a1159e00621c5 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -16,5 +17,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10 class D extends C { set ["set1"](p: Foo) { } ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt index f06d199ba5af5..937eb36a82682 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -17,5 +18,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11 [s: string]: Foo2; set ["set1"](p: Foo) { } ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt index 626ed14ad1ad3..b3f95bcd4d535 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -17,5 +18,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11 [s: string]: Foo2; set ["set1"](p: Foo) { } ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/declFileAccessors.errors.txt b/tests/baselines/reference/declFileAccessors.errors.txt new file mode 100644 index 0000000000000..7b1efec2818e7 --- /dev/null +++ b/tests/baselines/reference/declFileAccessors.errors.txt @@ -0,0 +1,107 @@ +tests/cases/compiler/declFileAccessors_0.ts(46,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/declFileAccessors_1.ts(46,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declFileAccessors_0.ts (1 errors) ==== + /** This is comment for c1*/ + export class c1 { + /** getter property*/ + public get p3() { + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { + } + /** private getter property*/ + private get pp3() { + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { + } + /** static getter property*/ + static get s3() { + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { + } + public get nc_p3() { + return 10; + } + public set nc_p3(value: number) { + } + private get nc_pp3() { + return 10; + } + private set nc_pp3(value: number) { + } + static get nc_s3() { + return ""; + } + static set nc_s3(value: string) { + } + + // Only getter property + public get onlyGetter() { + return 10; + } + + // Only setter property + public set onlySetter(value: number) { + ~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + +==== tests/cases/compiler/declFileAccessors_1.ts (1 errors) ==== + /** This is comment for c2 - the global class*/ + class c2 { + /** getter property*/ + public get p3() { + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { + } + /** private getter property*/ + private get pp3() { + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { + } + /** static getter property*/ + static get s3() { + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { + } + public get nc_p3() { + return 10; + } + public set nc_p3(value: number) { + } + private get nc_pp3() { + return 10; + } + private set nc_pp3(value: number) { + } + static get nc_s3() { + return ""; + } + static set nc_s3(value: string) { + } + + // Only getter property + public get onlyGetter() { + return 10; + } + + // Only setter property + public set onlySetter(value: number) { + ~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt new file mode 100644 index 0000000000000..9c13c9771d603 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts(4,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts (1 errors) ==== + function /*1*/makePoint(x: number) { + return { + b: 10, + set x(a: number) { this.b = a; } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + }; + }; + var /*3*/point = makePoint(2); + point./*2*/x = 30; \ No newline at end of file diff --git a/tests/baselines/reference/declFilePrivateStatic.errors.txt b/tests/baselines/reference/declFilePrivateStatic.errors.txt new file mode 100644 index 0000000000000..442c02de04ce0 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateStatic.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/declFilePrivateStatic.ts(11,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/declFilePrivateStatic.ts(12,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declFilePrivateStatic.ts (2 errors) ==== + class C { + private static x = 1; + static y = 1; + + private static a() { } + static b() { } + + private static get c() { return 1; } + static get d() { return 1; } + + private static set e(v) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + static set f(v) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt new file mode 100644 index 0000000000000..7d43db0ff22c8 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -0,0 +1,111 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(25,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(53,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(81,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts (3 errors) ==== + module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + ~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + ~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + ~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitClassMemberNameConflict.errors.txt b/tests/baselines/reference/declarationEmitClassMemberNameConflict.errors.txt new file mode 100644 index 0000000000000..9122aba6579ca --- /dev/null +++ b/tests/baselines/reference/declarationEmitClassMemberNameConflict.errors.txt @@ -0,0 +1,41 @@ +tests/cases/compiler/declarationEmitClassMemberNameConflict.ts(29,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declarationEmitClassMemberNameConflict.ts (1 errors) ==== + export class C1 { + C1() { } // has to be the same as the class name + + bar() { + return function (t: typeof C1) { + }; + } + } + + export class C2 { + C2: any // has to be the same as the class name + + bar() { + return function (t: typeof C2) { + }; + } + } + + export class C3 { + get C3() { return 0; } // has to be the same as the class name + + bar() { + return function (t: typeof C3) { + }; + } + } + + export class C4 { + set C4(v) { } // has to be the same as the class name + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + bar() { + return function (t: typeof C4) { + }; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitProtectedMembers.errors.txt b/tests/baselines/reference/declarationEmitProtectedMembers.errors.txt new file mode 100644 index 0000000000000..5343c3b13a9f7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitProtectedMembers.errors.txt @@ -0,0 +1,55 @@ +tests/cases/compiler/declarationEmitProtectedMembers.ts(18,26): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/declarationEmitProtectedMembers.ts (1 errors) ==== + // Class with protected members + class C1 { + protected x: number; + + protected f() { + return this.x; + } + + protected set accessor(a: number) { } + protected get accessor() { return 0; } + + protected static sx: number; + + protected static sf() { + return this.sx; + } + + protected static set staticSetter(a: number) { } + ~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + protected static get staticGetter() { return 0; } + } + + // Derived class overriding protected members + class C2 extends C1 { + protected f() { + return super.f() + this.x; + } + protected static sf() { + return super.sf() + this.sx; + } + } + + // Derived class making protected members public + class C3 extends C2 { + x: number; + static sx: number; + f() { + return super.f(); + } + static sf() { + return super.sf(); + } + + static get staticGetter() { return 1; } + } + + // Protected properties in constructors + class C4 { + constructor(protected a: number, protected b) { } + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor4.errors.txt new file mode 100644 index 0000000000000..71229bad83dad --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor4.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts(4,14): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts (1 errors) ==== + declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + + class C { + @dec set accessor(value: number) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor5.errors.txt new file mode 100644 index 0000000000000..27f9a96908a95 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts(4,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts (1 errors) ==== + declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + + class C { + @dec public set accessor(value: number) { } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt index e430b4cf1eea5..ce2a1ef9d97f7 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,12): error TS1005: ';' expected. +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (1 errors) ==== +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (2 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec set accessor(value: number) { } ~ !!! error TS1005: ';' expected. + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor8.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor8.errors.txt new file mode 100644 index 0000000000000..0fffb2900efe2 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor8.errors.txt @@ -0,0 +1,35 @@ +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor8.ts(28,14): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor8.ts (1 errors) ==== + declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + + class A { + @dec get x() { return 0; } + set x(value: number) { } + } + + class B { + get x() { return 0; } + @dec set x(value: number) { } + } + + class C { + @dec set x(value: number) { } + get x() { return 0; } + } + + class D { + set x(value: number) { } + @dec get x() { return 0; } + } + + class E { + @dec get x() { return 0; } + } + + class F { + @dec set x(value: number) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt index faf228e8d55c2..4e0c1aaef0d3d 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt @@ -6,6 +6,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve Property 'c' is protected in type 'Derived3' but public in type 'Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(37,7): error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. Property 'c' is protected in type 'Derived4' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,19): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(42,7): error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. Property 'd' is protected in type 'Derived5' but public in type 'Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(47,7): error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. @@ -16,11 +17,12 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(62,7): error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,26): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(67,7): error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. -==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts (10 errors) ==== +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts (12 errors) ==== var x: { foo: string; } var y: { foo: string; bar: string; } @@ -71,6 +73,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve !!! error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. !!! error TS2415: Property 'c' is protected in type 'Derived4' but public in type 'Base'. protected set c(v: typeof x) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. constructor(a: typeof x) { super(a); } } @@ -111,6 +115,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve !!! error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. !!! error TS2417: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. protected static set t(v: typeof x) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. constructor(a: typeof x) { super(a); } } diff --git a/tests/baselines/reference/downlevelLetConst18.errors.txt b/tests/baselines/reference/downlevelLetConst18.errors.txt index 3c3ae0e01e991..bbe1cac4278d9 100644 --- a/tests/baselines/reference/downlevelLetConst18.errors.txt +++ b/tests/baselines/reference/downlevelLetConst18.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. +tests/cases/compiler/downlevelLetConst18.ts(28,12): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/compiler/downlevelLetConst18.ts (2 errors) ==== +==== tests/cases/compiler/downlevelLetConst18.ts (3 errors) ==== 'use strict' for (let x; ;) { @@ -35,5 +36,7 @@ tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS1250: Function declar for (let x; ;) { ({ set foo(v) { x } }) + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index 4ac9176776888..7299be5dca7d3 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -4,6 +4,7 @@ tests/cases/compiler/duplicateClassElements.ts(6,12): error TS2393: Duplicate fu tests/cases/compiler/duplicateClassElements.ts(8,12): error TS2300: Duplicate identifier 'x'. tests/cases/compiler/duplicateClassElements.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(9,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(12,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/duplicateClassElements.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(12,9): error TS2300: Duplicate identifier 'x'. tests/cases/compiler/duplicateClassElements.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -11,6 +12,7 @@ tests/cases/compiler/duplicateClassElements.ts(18,9): error TS1056: Accessors ar tests/cases/compiler/duplicateClassElements.ts(21,12): error TS2300: Duplicate identifier 'z'. tests/cases/compiler/duplicateClassElements.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(23,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate identifier 'z'. tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -24,7 +26,7 @@ tests/cases/compiler/duplicateClassElements.ts(39,9): error TS2300: Duplicate id tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate identifier 'z2'. -==== tests/cases/compiler/duplicateClassElements.ts (24 errors) ==== +==== tests/cases/compiler/duplicateClassElements.ts (26 errors) ==== class a { public a; public a; @@ -50,6 +52,8 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i } set x(_x: number) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'x'. @@ -78,6 +82,8 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i } set z(_y: string) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'z'. diff --git a/tests/baselines/reference/dynamicNamesErrors.errors.txt b/tests/baselines/reference/dynamicNamesErrors.errors.txt index 0d4f44a59f573..732742e4fa9d0 100644 --- a/tests/baselines/reference/dynamicNamesErrors.errors.txt +++ b/tests/baselines/reference/dynamicNamesErrors.errors.txt @@ -7,9 +7,12 @@ tests/cases/compiler/dynamicNamesErrors.ts(24,1): error TS2322: Type 'T2' is not tests/cases/compiler/dynamicNamesErrors.ts(25,1): error TS2322: Type 'T1' is not assignable to type 'T2'. Types of property '[c0]' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/dynamicNamesErrors.ts(41,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/dynamicNamesErrors.ts(46,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/dynamicNamesErrors.ts(58,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/compiler/dynamicNamesErrors.ts (5 errors) ==== +==== tests/cases/compiler/dynamicNamesErrors.ts (8 errors) ==== const c0 = "1"; const c1 = 1; @@ -65,11 +68,15 @@ tests/cases/compiler/dynamicNamesErrors.ts(25,1): error TS2322: Type 'T1' is not static [y](): number { return 0; } static get [z](): number { return 0; } static set [w](value: number) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. [x]: number; [y](): number { return 0; } get [z](): number { return 0; } set [w](value: number) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } export type ObjectTypeVisibility = { @@ -82,4 +89,6 @@ tests/cases/compiler/dynamicNamesErrors.ts(25,1): error TS2322: Type 'T1' is not [y](): number { return 0; }, get [z](): number { return 0; }, set [w](value: number) { }, + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. }; \ No newline at end of file diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.errors.txt b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.errors.txt new file mode 100644 index 0000000000000..f65adec61713d --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.errors.txt @@ -0,0 +1,42 @@ +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts(19,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts(21,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts(24,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts(25,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts (4 errors) ==== + class C { + _name: string; + get name(): string { + return this._name; + } + static get name2(): string { + return "BYE"; + } + static get ["computedname"]() { + return ""; + } + get ["computedname1"]() { + return ""; + } + get ["computedname2"]() { + return ""; + } + + set ["computedname3"](x: any) { + ~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set ["computedname4"](y: string) { + ~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + set foo(a: string) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + static set bar(b: number) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + static set ["computedname"](b: string) { } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.errors.txt b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.errors.txt new file mode 100644 index 0000000000000..4967b6c2ab4bf --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithThisKeywordInES6.ts(15,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithThisKeywordInES6.ts (1 errors) ==== + class B { + x = 10; + constructor() { + this.x = 10; + } + static log(a: number) { } + foo() { + B.log(this.x); + } + + get X() { + return this.x; + } + + set bX(y: number) { + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + this.x = y; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.errors.txt b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.errors.txt new file mode 100644 index 0000000000000..10bfb299e6865 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts(19,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts (1 errors) ==== + class B { + x: T; + B: T; + + constructor(a: any) + constructor(a: any,b: T) + constructor(a: T) { this.B = a;} + + foo(a: T) + foo(a: any) + foo(b: string) + foo(): T { + return this.x; + } + + get BB(): T { + return this.B; + } + set BBWith(c: T) { + ~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + this.B = c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.errors.txt b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.errors.txt new file mode 100644 index 0000000000000..8deee3a8cfa77 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentInES6.ts(11,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentInES6.ts (1 errors) ==== + class B { + x: T; + B: T; + constructor(a: T) { this.B = a;} + foo(): T { + return this.x; + } + get BB(): T { + return this.B; + } + set BBWith(c: T) { + ~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + this.B = c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt index c459eee92901a..a1bc7bdb9a34b 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt +++ b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt @@ -2,6 +2,7 @@ tests/cases/compiler/errorsInGenericTypeReference.ts(11,17): error TS2304: Canno tests/cases/compiler/errorsInGenericTypeReference.ts(17,31): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(22,29): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(23,36): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(24,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/errorsInGenericTypeReference.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/errorsInGenericTypeReference.ts(24,27): error TS2304: Cannot find name 'V'. tests/cases/compiler/errorsInGenericTypeReference.ts(25,24): error TS2304: Cannot find name 'V'. @@ -22,7 +23,7 @@ tests/cases/compiler/errorsInGenericTypeReference.ts(67,40): error TS2304: Canno tests/cases/compiler/errorsInGenericTypeReference.ts(68,24): error TS2304: Cannot find name 'V'. -==== tests/cases/compiler/errorsInGenericTypeReference.ts (22 errors) ==== +==== tests/cases/compiler/errorsInGenericTypeReference.ts (23 errors) ==== interface IFoo { } class Foo { } @@ -56,6 +57,8 @@ tests/cases/compiler/errorsInGenericTypeReference.ts(68,24): error TS2304: Canno !!! error TS2304: Cannot find name 'V'. set a(value: Foo<{ x: V }>) { } // error: could not find symbol V ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2304: Cannot find name 'V'. diff --git a/tests/baselines/reference/es5SetterparameterDestructuringNotElided.errors.txt b/tests/baselines/reference/es5SetterparameterDestructuringNotElided.errors.txt new file mode 100644 index 0000000000000..d50beb8fe706b --- /dev/null +++ b/tests/baselines/reference/es5SetterparameterDestructuringNotElided.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/es5SetterparameterDestructuringNotElided.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/es5SetterparameterDestructuringNotElided.ts (1 errors) ==== + const foo = { + set foo([start, end]: [any, any]) { + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + void start; + void end; + }, + }; \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest2.errors.txt b/tests/baselines/reference/es6ClassTest2.errors.txt index 17d9d41ed03a5..69f9cd9bd493d 100644 --- a/tests/baselines/reference/es6ClassTest2.errors.txt +++ b/tests/baselines/reference/es6ClassTest2.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/es6ClassTest2.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/es6ClassTest2.ts (2 errors) ==== +==== tests/cases/compiler/es6ClassTest2.ts (3 errors) ==== class BasicMonster { constructor(public name: string, public health: number) { @@ -41,6 +42,8 @@ tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only av // Likewise, "set" can be used to define setters. set health(value: number) { ~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. if (value < 0) { throw new Error('Health must be non-negative.') diff --git a/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt b/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt index 4eccf0cc1ca92..aa78019cbc759 100644 --- a/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt +++ b/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt @@ -1,9 +1,10 @@ tests/cases/compiler/exportEqualsClassRedeclarationError.ts(2,16): error TS2300: Duplicate identifier 'someProp'. tests/cases/compiler/exportEqualsClassRedeclarationError.ts(6,16): error TS2300: Duplicate identifier 'someProp'. +tests/cases/compiler/exportEqualsClassRedeclarationError.ts(7,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/exportEqualsClassRedeclarationError.ts(7,16): error TS2300: Duplicate identifier 'someProp'. -==== tests/cases/compiler/exportEqualsClassRedeclarationError.ts (3 errors) ==== +==== tests/cases/compiler/exportEqualsClassRedeclarationError.ts (4 errors) ==== class SomeClass { static get someProp(): number { ~~~~~~~~ @@ -16,6 +17,8 @@ tests/cases/compiler/exportEqualsClassRedeclarationError.ts(7,16): error TS2300: !!! error TS2300: Duplicate identifier 'someProp'. static set someProp(value: number) {} ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS2300: Duplicate identifier 'someProp'. } export = SomeClass; \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames01.errors.txt b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames01.errors.txt index 767af3d75bed4..56854175e4fe7 100644 --- a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames01.errors.txt +++ b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames01.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/modules/t1.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/modules/t3.ts(1,17): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. -==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ==== +==== tests/cases/conformance/es6/modules/t1.ts (1 errors) ==== let set = { set foo(x: number) { + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } } let get = 10; diff --git a/tests/baselines/reference/getAndSetAsMemberNames.errors.txt b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt index a83c4ba118c3a..753f4ed4ed882 100644 --- a/tests/baselines/reference/getAndSetAsMemberNames.errors.txt +++ b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/getAndSetAsMemberNames.ts(19,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/getAndSetAsMemberNames.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/getAndSetAsMemberNames.ts (1 errors) ==== +==== tests/cases/compiler/getAndSetAsMemberNames.ts (2 errors) ==== class C1 { set: boolean; get = 1; @@ -22,6 +23,8 @@ tests/cases/compiler/getAndSetAsMemberNames.ts(19,9): error TS1056: Accessors ar get (): boolean { return true; } set t(x) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index eb899ff132e6d..749f03f4955af 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -2,15 +2,18 @@ tests/cases/compiler/giant.ts(22,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(23,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(23,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(24,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(25,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(25,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(25,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(26,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(27,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(27,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(28,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(29,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(29,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(29,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(32,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(33,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(33,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(33,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(34,12): error TS2300: Duplicate identifier 'tgF'. @@ -25,15 +28,18 @@ tests/cases/compiler/giant.ts(86,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(87,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(87,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(88,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(89,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(89,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(89,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(90,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(91,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(91,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(92,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(93,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(93,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(93,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(96,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(97,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(97,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(97,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(98,16): error TS2300: Duplicate identifier 'tgF'. @@ -49,15 +55,18 @@ tests/cases/compiler/giant.ts(165,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(166,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(166,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(167,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(168,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(168,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(168,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(169,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(170,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(170,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(171,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(172,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(172,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(172,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(175,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(176,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(176,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(176,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(177,16): error TS2300: Duplicate identifier 'tgF'. @@ -79,6 +88,7 @@ tests/cases/compiler/giant.ts(245,20): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(245,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(246,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(246,31): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(247,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(247,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(247,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(248,17): error TS2300: Duplicate identifier 'rgF'. @@ -87,11 +97,13 @@ tests/cases/compiler/giant.ts(249,21): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(249,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(250,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(250,32): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(251,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(251,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(251,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(253,21): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(254,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(254,31): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(255,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(255,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(255,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(256,16): error TS2300: Duplicate identifier 'tgF'. @@ -105,15 +117,18 @@ tests/cases/compiler/giant.ts(280,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(281,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(281,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(282,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(283,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(283,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(283,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(284,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(285,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(285,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(286,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(287,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(287,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(287,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(290,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(291,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(291,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(291,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(292,12): error TS2300: Duplicate identifier 'tgF'. @@ -128,15 +143,18 @@ tests/cases/compiler/giant.ts(344,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(345,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(345,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(346,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(347,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(347,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(347,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(348,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(349,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(349,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(350,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(351,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(351,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(351,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(354,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(355,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(355,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(355,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(356,16): error TS2300: Duplicate identifier 'tgF'. @@ -152,15 +170,18 @@ tests/cases/compiler/giant.ts(423,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(424,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(424,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(425,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(426,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(426,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(426,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(427,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(428,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(428,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(429,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(430,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(430,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(430,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(433,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(434,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(434,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(434,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(435,16): error TS2300: Duplicate identifier 'tgF'. @@ -182,6 +203,7 @@ tests/cases/compiler/giant.ts(503,20): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(503,20): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(504,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(504,31): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(505,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(505,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(505,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(506,17): error TS2300: Duplicate identifier 'rgF'. @@ -190,11 +212,13 @@ tests/cases/compiler/giant.ts(507,21): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(507,21): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(508,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(508,32): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(509,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(509,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(509,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(511,21): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(512,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(512,31): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(513,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(513,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(513,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(514,16): error TS2300: Duplicate identifier 'tgF'. @@ -214,6 +238,7 @@ tests/cases/compiler/giant.ts(539,16): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(539,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(540,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(540,27): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(541,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(541,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(541,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(542,13): error TS2300: Duplicate identifier 'rgF'. @@ -222,11 +247,13 @@ tests/cases/compiler/giant.ts(543,17): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(543,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(544,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(544,28): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(545,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(545,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(545,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(547,17): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/compiler/giant.ts(548,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(548,27): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/giant.ts(549,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/giant.ts(549,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(549,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(550,12): error TS2300: Duplicate identifier 'tgF'. @@ -265,7 +292,7 @@ tests/cases/compiler/giant.ts(671,25): error TS1036: Statements are not allowed tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be declared in ambient contexts. -==== tests/cases/compiler/giant.ts (265 errors) ==== +==== tests/cases/compiler/giant.ts (292 errors) ==== /* Prefixes p -> public @@ -300,6 +327,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -316,6 +345,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -326,6 +357,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -410,6 +443,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -426,6 +461,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -436,6 +473,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -537,6 +576,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -553,6 +594,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -563,6 +606,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -676,6 +721,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -696,6 +743,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -710,6 +759,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -764,6 +815,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -780,6 +833,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -790,6 +845,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -874,6 +931,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -890,6 +949,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -900,6 +961,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -1001,6 +1064,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -1017,6 +1082,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -1027,6 +1094,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -1140,6 +1209,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -1160,6 +1231,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -1174,6 +1247,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. @@ -1240,6 +1315,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. public set psF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'psF'. @@ -1260,6 +1337,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. private set rsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. @@ -1274,6 +1353,8 @@ tests/cases/compiler/giant.ts(675,30): error TS1183: An implementation cannot be !!! error TS1183: An implementation cannot be declared in ambient contexts. static set tsF(param:any) ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! error TS2300: Duplicate identifier 'tsF'. diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt index dac0b5486c909..eb860cd1bbd72 100644 --- a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(3,5): error TS7008: Member 'getAndSet' implicitly has an 'any' type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS7032: Property 'haveOnlySet' implicitly has type 'any', because its set accessor lacks a parameter type annotation. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,28): error TS7006: Parameter 'newXValue' implicitly has an 'any' type. @@ -8,7 +9,7 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): er tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. -==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (8 errors) ==== +==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (9 errors) ==== // these should be errors class GetAndSet { getAndSet = null; // error at "getAndSet" @@ -31,6 +32,8 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): er class SetterOnly { public set haveOnlySet(newXValue) { // error at "haveOnlySet, newXValue" ~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~ !!! error TS7032: Property 'haveOnlySet' implicitly has type 'any', because its set accessor lacks a parameter type annotation. diff --git a/tests/baselines/reference/interfaceImplementation5.errors.txt b/tests/baselines/reference/interfaceImplementation5.errors.txt index 882d851612183..82f3b1f90f83a 100644 --- a/tests/baselines/reference/interfaceImplementation5.errors.txt +++ b/tests/baselines/reference/interfaceImplementation5.errors.txt @@ -1,14 +1,16 @@ tests/cases/compiler/interfaceImplementation5.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(10,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/interfaceImplementation5.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/interfaceImplementation5.ts(14,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/interfaceImplementation5.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/interfaceImplementation5.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(23,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/interfaceImplementation5.ts(23,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/interfaceImplementation5.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/interfaceImplementation5.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/interfaceImplementation5.ts (8 errors) ==== +==== tests/cases/compiler/interfaceImplementation5.ts (10 errors) ==== interface I1 { getset1:number; } @@ -22,6 +24,8 @@ tests/cases/compiler/interfaceImplementation5.ts(28,16): error TS1056: Accessors class C2 implements I1 { public set getset1(baz:number){} ~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } @@ -43,6 +47,8 @@ tests/cases/compiler/interfaceImplementation5.ts(28,16): error TS1056: Accessors class C5 implements I1 { public set getset1(baz:any){} ~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } diff --git a/tests/baselines/reference/invalidNewTarget.es5.errors.txt b/tests/baselines/reference/invalidNewTarget.es5.errors.txt index 080267c36eb47..ecf36e6368a12 100644 --- a/tests/baselines/reference/invalidNewTarget.es5.errors.txt +++ b/tests/baselines/reference/invalidNewTarget.es5.errors.txt @@ -3,21 +3,24 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(2,17): error TS170 tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(5,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(6,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(7,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(8,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(8,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(9,15): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(11,13): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(12,25): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(13,29): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(14,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(14,27): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(15,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(19,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(20,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(21,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(22,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(22,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(23,8): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. -==== tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts (17 errors) ==== +==== tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts (20 errors) ==== const a = new.target; ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. @@ -36,6 +39,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. set e(_) { _ = new.target; } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. f = () => new.target; @@ -52,6 +57,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. static set i(_) { _ = new.target; } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. static j = () => new.target; @@ -70,6 +77,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. set m(_) { _ = new.target; }, + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. n: new.target, diff --git a/tests/baselines/reference/invalidNewTarget.es6.errors.txt b/tests/baselines/reference/invalidNewTarget.es6.errors.txt index ee5404ed781d2..e9f625c516ce1 100644 --- a/tests/baselines/reference/invalidNewTarget.es6.errors.txt +++ b/tests/baselines/reference/invalidNewTarget.es6.errors.txt @@ -3,21 +3,24 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(2,17): error TS170 tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(5,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(6,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(7,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(8,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(8,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(9,15): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(11,13): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(12,25): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(13,29): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(14,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(14,27): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(15,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(19,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(20,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(21,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. +tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(22,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(22,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(23,8): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. -==== tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts (17 errors) ==== +==== tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts (20 errors) ==== const a = new.target; ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. @@ -36,6 +39,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. set e(_) { _ = new.target; } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. f = () => new.target; @@ -52,6 +57,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. static set i(_) { _ = new.target; } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. static j = () => new.target; @@ -70,6 +77,8 @@ tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(23,8): error TS170 ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. set m(_) { _ = new.target; }, + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~ !!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor. n: new.target, diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt b/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt new file mode 100644 index 0000000000000..89131eed3e416 --- /dev/null +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt @@ -0,0 +1,74 @@ +tests/cases/compiler/isDeclarationVisibleNodeKinds.ts(65,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/isDeclarationVisibleNodeKinds.ts (1 errors) ==== + // Function types + module schema { + export function createValidator1(schema: any): (data: T) => T { + return undefined; + } + } + + // Constructor types + module schema { + export function createValidator2(schema: any): new (data: T) => T { + return undefined; + } + } + + // union types + module schema { + export function createValidator3(schema: any): number | { new (data: T): T; } { + return undefined; + } + } + + // Array types + module schema { + export function createValidator4(schema: any): { new (data: T): T; }[] { + return undefined; + } + } + + + // TypeLiterals + module schema { + export function createValidator5(schema: any): { new (data: T): T } { + return undefined; + } + } + + // Tuple types + module schema { + export function createValidator6(schema: any): [ new (data: T) => T, number] { + return undefined; + } + } + + // Paren Types + module schema { + export function createValidator7(schema: any): (new (data: T)=>T )[] { + return undefined; + } + } + + // Type reference + module schema { + export function createValidator8(schema: any): Array<{ (data: T) : T}> { + return undefined; + } + } + + + module schema { + export class T { + get createValidator9(): (data: T) => T { + return undefined; + } + + set createValidator10(v: (data: T) => T) { + ~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.errors.txt b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.errors.txt index 434058d13a4de..58a74991e5569 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.errors.txt +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.errors.txt @@ -1,14 +1,18 @@ +tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(3,25): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(3,25): error TS7032: Property 'message' implicitly has type 'any', because its set accessor lacks a parameter type annotation. tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(3,33): error TS7006: Parameter 'str' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(8,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(8,16): error TS7032: Property 'message' implicitly has type 'any', because its set accessor lacks a parameter type annotation. tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(8,24): error TS7006: Parameter 'str' implicitly has an 'any' type. -==== tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts (4 errors) ==== +==== tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts (6 errors) ==== abstract class Parent { public abstract set message(str); ~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~ !!! error TS7032: Property 'message' implicitly has type 'any', because its set accessor lacks a parameter type annotation. ~~~ !!! error TS7006: Parameter 'str' implicitly has an 'any' type. @@ -18,6 +22,8 @@ tests/cases/compiler/noImplicitAnyMissingGetAccessor.ts(8,24): error TS7006: Par _x: any; public set message(str) { ~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~ !!! error TS7032: Property 'message' implicitly has type 'any', because its set accessor lacks a parameter type annotation. ~~~ !!! error TS7006: Parameter 'str' implicitly has an 'any' type. diff --git a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt index 99b4f5c4ae01d..25399a08241d1 100644 --- a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt +++ b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt @@ -1,15 +1,18 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(1,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(2,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(3,40): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts (4 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts (5 errors) ==== var e1 = { get a() { return 4; } }; ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var e2 = { set a(n) { } }; ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var e3 = { get a() { return ''; }, set a(n) { } }; ~ diff --git a/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt index 1290859fbf9f0..0f95f043df588 100644 --- a/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt +++ b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt @@ -12,7 +12,9 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetter tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(7,50): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(18,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(22,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(26,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(26,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(30,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(30,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(35,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(35,62): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -34,7 +36,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetter tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(77,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts (34 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts (36 errors) ==== // Get and set accessor with the same name var sameName1a = { get 'a'() { return ''; }, set a(n) { var p = n; var p: string; } }; ~~~ @@ -90,12 +92,16 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetter // Set accessor only, type of the property is the param type of the set accessor var setter1 = { set x(n: number) { } }; ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var setter1: { x: number }; // Set accessor only, type of the property is Any for an unannotated set accessor var setter2 = { set x(n) { } }; ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var setter2: { x: any }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt index 5fa8a12e87559..2f505819d3d2a 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(3,20): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(4,7): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(5,10): error TS1005: '(' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(6,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(6,10): error TS1005: '(' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(7,9): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(8,10): error TS1005: ':' expected. @@ -13,7 +14,7 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. -==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (13 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (14 errors) ==== // errors var y = { "stringLiteral", @@ -26,6 +27,8 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr ~ !!! error TS1005: '(' expected. set f, + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS1005: '(' expected. this, diff --git a/tests/baselines/reference/objectRest.errors.txt b/tests/baselines/reference/objectRest.errors.txt new file mode 100644 index 0000000000000..d03cee360b57e --- /dev/null +++ b/tests/baselines/reference/objectRest.errors.txt @@ -0,0 +1,53 @@ +tests/cases/conformance/types/rest/objectRest.ts(24,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/types/rest/objectRest.ts (1 errors) ==== + var o = { a: 1, b: 'no' } + var { ...clone } = o; + var { a, ...justB } = o; + var { a, b: renamed, ...empty } = o; + var { ['b']: renamed, ...justA } = o; + var { 'b': renamed, ...justA } = o; + var { b: { '0': n, '1': oooo }, ...justA } = o; + + let o2 = { c: 'terrible idea?', d: 'yes' }; + var { d: renamed, ...d } = o2; + + let nestedrest: { x: number, n1: { y: number, n2: { z: number, n3: { n4: number } } }, rest: number, restrest: number }; + var { x, n1: { y, n2: { z, n3: { ...nr } } }, ...restrest } = nestedrest; + + let complex: { x: { ka, ki }, y: number }; + var { x: { ka, ...nested }, y: other, ...rest } = complex; + ({x: { ka, ...nested }, y: other, ...rest} = complex); + var { x, ...fresh } = { x: 1, y: 2 }; + ({ x, ...fresh } = { x: 1, y: 2 }); + + class Removable { + private x: number; + protected y: number; + set z(value: number) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + get both(): number { return 12 } + set both(value: number) { } + m() { } + removed: string; + remainder: string; + } + interface I { + m(): void; + removed: string; + remainder: string; + } + var removable = new Removable(); + var { removed, ...removableRest } = removable; + var i: I = removable; + var { removed, ...removableRest2 } = i; + + let computed = 'b'; + let computed2 = 'a'; + var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o; + ({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o); + + var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes; + \ No newline at end of file diff --git a/tests/baselines/reference/objectRestParameter.errors.txt b/tests/baselines/reference/objectRestParameter.errors.txt new file mode 100644 index 0000000000000..8dde7d4265219 --- /dev/null +++ b/tests/baselines/reference/objectRestParameter.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/types/rest/objectRestParameter.ts(12,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/types/rest/objectRestParameter.ts (1 errors) ==== + function cloneAgain({ a, ...clone }: { a: number, b: string }): void { + } + + declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void); + suddenly(({ x: a, ...rest }) => rest.y); + suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka); + + class C { + m({ a, ...clone }: { a: number, b: string}): void { + // actually, never mind, don't clone + } + set p({ a, ...clone }: { a: number, b: string}) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + // actually, never mind, don't clone + } + } + function foobar({ bar={}, ...opts }: any = {}) { + } + foobar(); + foobar({ baz: 'hello' }); + foobar({ bar: { greeting: 'hello' } }); + \ No newline at end of file diff --git a/tests/baselines/reference/objectRestParameterES5.errors.txt b/tests/baselines/reference/objectRestParameterES5.errors.txt new file mode 100644 index 0000000000000..a45535facf85f --- /dev/null +++ b/tests/baselines/reference/objectRestParameterES5.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/types/rest/objectRestParameterES5.ts(12,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/types/rest/objectRestParameterES5.ts (1 errors) ==== + function cloneAgain({ a, ...clone }: { a: number, b: string }): void { + } + + declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void); + suddenly(({ x: a, ...rest }) => rest.y); + suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka); + + class C { + m({ a, ...clone }: { a: number, b: string}): void { + // actually, never mind, don't clone + } + set p({ a, ...clone }: { a: number, b: string}) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + // actually, never mind, don't clone + } + } + function foobar({ bar={}, ...opts }: any = {}) { + } + foobar(); + foobar({ baz: 'hello' }); + foobar({ bar: { greeting: 'hello' } }); + \ No newline at end of file diff --git a/tests/baselines/reference/objectSpreadNegative.errors.txt b/tests/baselines/reference/objectSpreadNegative.errors.txt index 92225755c7191..f6ad70c1022b8 100644 --- a/tests/baselines/reference/objectSpreadNegative.errors.txt +++ b/tests/baselines/reference/objectSpreadNegative.errors.txt @@ -13,6 +13,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(34,20): error TS269 tests/cases/conformance/types/spread/objectSpreadNegative.ts(36,20): error TS2698: Spread types may only be created from object types. tests/cases/conformance/types/spread/objectSpreadNegative.ts(38,19): error TS2698: Spread types may only be created from object types. tests/cases/conformance/types/spread/objectSpreadNegative.ts(43,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. +tests/cases/conformance/types/spread/objectSpreadNegative.ts(46,29): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/types/spread/objectSpreadNegative.ts(47,12): error TS2339: Property 'b' does not exist on type '{}'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(53,9): error TS2339: Property 'm' does not exist on type '{ p: number; }'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(58,11): error TS2339: Property 'a' does not exist on type '{}'. @@ -26,7 +27,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(84,7): error TS2322 Object literal may only specify known properties, and 'extra' does not exist in type 'A'. -==== tests/cases/conformance/types/spread/objectSpreadNegative.ts (20 errors) ==== +==== tests/cases/conformance/types/spread/objectSpreadNegative.ts (21 errors) ==== let o = { a: 1, b: 'no' } /// private propagates @@ -100,6 +101,8 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(84,7): error TS2322 // write-only properties get skipped let setterOnly = { ...{ set b (bad: number) { } } }; + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. setterOnly.b = 12; // error, 'b' does not exist ~ !!! error TS2339: Property 'b' does not exist on type '{}'. diff --git a/tests/baselines/reference/optionalSetterParam.errors.txt b/tests/baselines/reference/optionalSetterParam.errors.txt index 732351671ce25..85642bced0e93 100644 --- a/tests/baselines/reference/optionalSetterParam.errors.txt +++ b/tests/baselines/reference/optionalSetterParam.errors.txt @@ -1,11 +1,14 @@ +tests/cases/compiler/optionalSetterParam.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/optionalSetterParam.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/optionalSetterParam.ts (1 errors) ==== +==== tests/cases/compiler/optionalSetterParam.ts (2 errors) ==== class foo { public set bar(param?:any) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors2.errors.txt b/tests/baselines/reference/parserAccessors2.errors.txt new file mode 100644 index 0000000000000..0571ad2b60992 --- /dev/null +++ b/tests/baselines/reference/parserAccessors2.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts (1 errors) ==== + class C { + set Foo(a) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors4.errors.txt b/tests/baselines/reference/parserAccessors4.errors.txt new file mode 100644 index 0000000000000..bd60e42e959c4 --- /dev/null +++ b/tests/baselines/reference/parserAccessors4.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts(1,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts (1 errors) ==== + var v = { set Foo(a) { } }; + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors6.errors.txt b/tests/baselines/reference/parserAccessors6.errors.txt index 023ec6d79c345..4089a2195b4da 100644 --- a/tests/baselines/reference/parserAccessors6.errors.txt +++ b/tests/baselines/reference/parserAccessors6.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors6.ts(2,7): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors6.ts(2,7): error TS1086: An accessor cannot be declared in an ambient context. -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors6.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors6.ts (2 errors) ==== declare class C { set foo(v) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1086: An accessor cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors8.errors.txt b/tests/baselines/reference/parserAccessors8.errors.txt index 38459f4cf4cf7..229b4e8b67f6a 100644 --- a/tests/baselines/reference/parserAccessors8.errors.txt +++ b/tests/baselines/reference/parserAccessors8.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors8.ts(1,15): error TS1049: A 'set' accessor must have exactly one parameter. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors8.ts(1,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors8.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors8.ts (2 errors) ==== var v = { set foo() { } } ~~~ -!!! error TS1049: A 'set' accessor must have exactly one parameter. \ No newline at end of file +!!! error TS1049: A 'set' accessor must have exactly one parameter. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors9.errors.txt b/tests/baselines/reference/parserAccessors9.errors.txt index 88ae0e81d4317..4b1aff716f86c 100644 --- a/tests/baselines/reference/parserAccessors9.errors.txt +++ b/tests/baselines/reference/parserAccessors9.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors9.ts(1,15): error TS1049: A 'set' accessor must have exactly one parameter. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors9.ts(1,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors9.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors9.ts (2 errors) ==== var v = { set foo(a, b) { } } ~~~ -!!! error TS1049: A 'set' accessor must have exactly one parameter. \ No newline at end of file +!!! error TS1049: A 'set' accessor must have exactly one parameter. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors2.errors.txt b/tests/baselines/reference/parserES3Accessors2.errors.txt index 006e31145a6c9..5a6ecb4d4ca6d 100644 --- a/tests/baselines/reference/parserES3Accessors2.errors.txt +++ b/tests/baselines/reference/parserES3Accessors2.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts (2 errors) ==== class C { set Foo(a) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors4.errors.txt b/tests/baselines/reference/parserES3Accessors4.errors.txt index 8ac3df5ddb1da..20f1ef44c0089 100644 --- a/tests/baselines/reference/parserES3Accessors4.errors.txt +++ b/tests/baselines/reference/parserES3Accessors4.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts(1,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts (2 errors) ==== var v = { set Foo(a) { } }; ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt index 7359a53299f2d..d9be818d68ea3 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration13.ts(2,8): error TS1049: A 'set' accessor must have exactly one parameter. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration13.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration13.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration13.ts (2 errors) ==== class C { set Foo() { } ~~~ !!! error TS1049: A 'set' accessor must have exactly one parameter. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt index 016caa3d7e390..95a8af5a0a463 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration14.ts(2,8): error TS1049: A 'set' accessor must have exactly one parameter. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration14.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration14.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration14.ts (2 errors) ==== class C { set Foo(a: number, b: number) { } ~~~ !!! error TS1049: A 'set' accessor must have exactly one parameter. + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt index cba1e1fee92ea..ed1936af8b7cd 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration15.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration15.ts(2,12): error TS2369: A parameter property is only allowed in a constructor implementation. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration15.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration15.ts (2 errors) ==== class C { set Foo(public a: number) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt index 11f39198d7894..e4360b829d6c1 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration16.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration16.ts(2,8): error TS1052: A 'set' accessor parameter cannot have an initializer. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration16.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration16.ts (2 errors) ==== class C { set Foo(a = 1) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1052: A 'set' accessor parameter cannot have an initializer. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt index 2d7f6e3be3093..4272fc2dd3ac6 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration17.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration17.ts(2,13): error TS1051: A 'set' accessor cannot have an optional parameter. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration17.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration17.ts (2 errors) ==== class C { set Foo(a?: number) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS1051: A 'set' accessor cannot have an optional parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt index 8296a087bab48..81bcb011c5328 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration18.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration18.ts(2,12): error TS1053: A 'set' accessor cannot have rest parameter. -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration18.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration18.ts (2 errors) ==== class C { set Foo(...a) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~ !!! error TS1053: A 'set' accessor cannot have rest parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt new file mode 100644 index 0000000000000..6437d8a565ef5 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts(2,7): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts (1 errors) ==== + class C { + set a(i) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt new file mode 100644 index 0000000000000..e7a5605e55c42 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts(2,7): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts (1 errors) ==== + class C { + set "a"(i) { } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt new file mode 100644 index 0000000000000..b4296b12e41b3 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts(2,7): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts (1 errors) ==== + class C { + set 0(i) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt index 25123c17f6088..84aa847624b44 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt +++ b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeAnnotation1.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeAnnotation1.ts(2,8): error TS1095: A 'set' accessor cannot have a return type annotation. -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeAnnotation1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeAnnotation1.ts (2 errors) ==== class C { set foo(v): number { ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1095: A 'set' accessor cannot have a return type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt index a70ebe24f5bc9..f73e4cc3aad74 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeParameters1.ts(2,8): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeParameters1.ts(2,8): error TS1094: An accessor cannot have type parameters. -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeParameters1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserSetAccessorWithTypeParameters1.ts (2 errors) ==== class C { set foo(v) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1094: An accessor cannot have type parameters. } \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode12.errors.txt b/tests/baselines/reference/parserStrictMode12.errors.txt index 4daec36feb8b2..0239a20eaea1c 100644 --- a/tests/baselines/reference/parserStrictMode12.errors.txt +++ b/tests/baselines/reference/parserStrictMode12.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts(2,15): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts(2,19): error TS1100: Invalid use of 'eval' in strict mode. -==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts (2 errors) ==== "use strict"; var v = { set foo(eval) { } } + ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt new file mode 100644 index 0000000000000..6758d2c76c9cb --- /dev/null +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -0,0 +1,1371 @@ +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(32,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(34,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(36,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(38,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(164,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(166,32): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(168,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(170,25): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(175,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(177,32): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(179,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(181,25): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(186,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(188,32): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(190,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(192,25): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(197,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(199,32): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(201,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(203,25): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(223,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(225,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(245,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(247,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(363,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(367,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(372,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(374,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(376,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(378,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(383,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(385,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(387,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(389,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(394,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(396,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(398,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(400,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(442,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(444,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(116,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(118,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(120,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(122,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(127,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(129,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(131,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(133,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(138,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(140,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(142,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(144,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(149,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(151,24): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(153,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(155,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(175,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(177,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(197,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(199,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(318,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(320,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(322,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(324,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(329,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(331,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(333,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(335,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(340,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(342,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(344,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(346,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(351,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(353,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(355,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(357,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(377,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(379,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(399,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(401,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(521,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(523,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(525,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(527,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(532,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(534,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(536,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(538,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(543,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(545,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(547,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(549,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(554,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(556,28): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(558,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(560,21): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(580,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(582,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(602,20): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(604,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts (60 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export module publicModule { + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + } + + module privateModule { + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + } + +==== tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts (44 errors) ==== + class publicClassInGlobal { + } + + class publicClassInGlobalWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClassInGlobal { + return null; + } + private static get myPrivateStaticMethod(): publicClassInGlobal { + return null; + } + get myPublicMethod(): publicClassInGlobal { + return null; + } + private get myPrivateMethod(): publicClassInGlobal { + return null; + } + static get myPublicStaticMethod1() { + return new publicClassInGlobal(); + } + private static get myPrivateStaticMethod1() { + return new publicClassInGlobal(); + } + get myPublicMethod1() { + return new publicClassInGlobal(); + } + private get myPrivateMethod1() { + return new publicClassInGlobal(); + } + } + + class publicClassInGlobalWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClassInGlobal) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClassInGlobal) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClassInGlobal) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClassInGlobal) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + module publicModuleInGlobal { + class privateClass { + } + + export class publicClass { + } + + module privateModule { + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + } + + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: privateClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: privateClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private static set myPrivateStaticMethod(param: publicClass) { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + private set myPrivateMethod(param: publicClass) { + ~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { // Error + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + set myPublicMethod(param: privateModule.publicClass) { + ~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyAccessorDeclFile.js b/tests/baselines/reference/privacyAccessorDeclFile.js index 0edef02a54dfd..ddfb1f2382a2b 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.js +++ b/tests/baselines/reference/privacyAccessorDeclFile.js @@ -3815,274 +3815,3 @@ declare module publicModuleInGlobal { myPublicMethod: privateModule.publicClass; } } - - -//// [DtsFileErrors] - - -tests/cases/compiler/privacyAccessorDeclFile_externalModule.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. - - -==== tests/cases/compiler/privacyAccessorDeclFile_externalModule.d.ts (1 errors) ==== - class privateClass { - ~~~~~ -!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. - } - export declare class publicClass { - } - export declare class publicClassWithWithPrivateGetAccessorTypes { - static readonly myPublicStaticMethod: privateClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: privateClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: privateClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: privateClass; - private readonly myPrivateMethod1; - } - export declare class publicClassWithWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClass; - private readonly myPrivateMethod1; - } - export declare class publicClassWithWithPrivateSetAccessorTypes { - static myPublicStaticMethod: privateClass; - private static myPrivateStaticMethod; - myPublicMethod: privateClass; - private myPrivateMethod; - } - export declare class publicClassWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClass; - private static myPrivateStaticMethod; - myPublicMethod: publicClass; - private myPrivateMethod; - } - export declare class publicClassWithPrivateModuleGetAccessorTypes { - static readonly myPublicStaticMethod: privateModule.publicClass; - readonly myPublicMethod: privateModule.publicClass; - static readonly myPublicStaticMethod1: privateModule.publicClass; - readonly myPublicMethod1: privateModule.publicClass; - } - export declare class publicClassWithPrivateModuleSetAccessorTypes { - static myPublicStaticMethod: privateModule.publicClass; - myPublicMethod: privateModule.publicClass; - } - export declare module publicModule { - class privateClass { - } - class publicClass { - } - class publicClassWithWithPrivateGetAccessorTypes { - static readonly myPublicStaticMethod: privateClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: privateClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: privateClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: privateClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPrivateSetAccessorTypes { - static myPublicStaticMethod: privateClass; - private static myPrivateStaticMethod; - myPublicMethod: privateClass; - private myPrivateMethod; - } - class publicClassWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClass; - private static myPrivateStaticMethod; - myPublicMethod: publicClass; - private myPrivateMethod; - } - class publicClassWithPrivateModuleGetAccessorTypes { - static readonly myPublicStaticMethod: privateModule.publicClass; - readonly myPublicMethod: privateModule.publicClass; - static readonly myPublicStaticMethod1: privateModule.publicClass; - readonly myPublicMethod1: privateModule.publicClass; - } - class publicClassWithPrivateModuleSetAccessorTypes { - static myPublicStaticMethod: privateModule.publicClass; - myPublicMethod: privateModule.publicClass; - } - } - declare module privateModule { - class privateClass { - } - class publicClass { - } - class publicClassWithWithPrivateGetAccessorTypes { - static readonly myPublicStaticMethod: privateClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: privateClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: privateClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: privateClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPrivateSetAccessorTypes { - static myPublicStaticMethod: privateClass; - private static myPrivateStaticMethod; - myPublicMethod: privateClass; - private myPrivateMethod; - } - class publicClassWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClass; - private static myPrivateStaticMethod; - myPublicMethod: publicClass; - private myPrivateMethod; - } - class publicClassWithPrivateModuleGetAccessorTypes { - static readonly myPublicStaticMethod: privateModule.publicClass; - readonly myPublicMethod: privateModule.publicClass; - static readonly myPublicStaticMethod1: publicClass; - readonly myPublicMethod1: publicClass; - } - class publicClassWithPrivateModuleSetAccessorTypes { - static myPublicStaticMethod: privateModule.publicClass; - myPublicMethod: privateModule.publicClass; - } - } - export {}; - -==== tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.d.ts (0 errors) ==== - declare class publicClassInGlobal { - } - declare class publicClassInGlobalWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClassInGlobal; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClassInGlobal; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClassInGlobal; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClassInGlobal; - private readonly myPrivateMethod1; - } - declare class publicClassInGlobalWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClassInGlobal; - private static myPrivateStaticMethod; - myPublicMethod: publicClassInGlobal; - private myPrivateMethod; - } - declare module publicModuleInGlobal { - class privateClass { - } - class publicClass { - } - module privateModule { - class privateClass { - } - class publicClass { - } - class publicClassWithWithPrivateGetAccessorTypes { - static readonly myPublicStaticMethod: privateClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: privateClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: privateClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: privateClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPrivateSetAccessorTypes { - static myPublicStaticMethod: privateClass; - private static myPrivateStaticMethod; - myPublicMethod: privateClass; - private myPrivateMethod; - } - class publicClassWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClass; - private static myPrivateStaticMethod; - myPublicMethod: publicClass; - private myPrivateMethod; - } - class publicClassWithPrivateModuleGetAccessorTypes { - static readonly myPublicStaticMethod: privateModule.publicClass; - readonly myPublicMethod: privateModule.publicClass; - static readonly myPublicStaticMethod1: publicClass; - readonly myPublicMethod1: publicClass; - } - class publicClassWithPrivateModuleSetAccessorTypes { - static myPublicStaticMethod: privateModule.publicClass; - myPublicMethod: privateModule.publicClass; - } - } - class publicClassWithWithPrivateGetAccessorTypes { - static readonly myPublicStaticMethod: privateClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: privateClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: privateClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: privateClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPublicGetAccessorTypes { - static readonly myPublicStaticMethod: publicClass; - private static readonly myPrivateStaticMethod; - readonly myPublicMethod: publicClass; - private readonly myPrivateMethod; - static readonly myPublicStaticMethod1: publicClass; - private static readonly myPrivateStaticMethod1; - readonly myPublicMethod1: publicClass; - private readonly myPrivateMethod1; - } - class publicClassWithWithPrivateSetAccessorTypes { - static myPublicStaticMethod: privateClass; - private static myPrivateStaticMethod; - myPublicMethod: privateClass; - private myPrivateMethod; - } - class publicClassWithWithPublicSetAccessorTypes { - static myPublicStaticMethod: publicClass; - private static myPrivateStaticMethod; - myPublicMethod: publicClass; - private myPrivateMethod; - } - class publicClassWithPrivateModuleGetAccessorTypes { - static readonly myPublicStaticMethod: privateModule.publicClass; - readonly myPublicMethod: privateModule.publicClass; - static readonly myPublicStaticMethod1: privateModule.publicClass; - readonly myPublicMethod1: privateModule.publicClass; - } - class publicClassWithPrivateModuleSetAccessorTypes { - static myPublicStaticMethod: privateModule.publicClass; - myPublicMethod: privateModule.publicClass; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt b/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt index 620f4dc5940a3..10bfea0942e74 100644 --- a/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt +++ b/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt @@ -2,16 +2,18 @@ tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWi tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(3,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(9,5): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(10,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(10,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(14,13): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(15,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(18,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(18,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts(18,9): error TS2300: Duplicate identifier 'x'. -==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts (11 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts (13 errors) ==== class C { x: number; ~ @@ -31,6 +33,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWi !!! error TS2300: Duplicate identifier 'x'. set x(v) { } // error ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'x'. @@ -49,6 +53,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWi } set x(v) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'x'. diff --git a/tests/baselines/reference/readonlyInNonPropertyParameters.errors.txt b/tests/baselines/reference/readonlyInNonPropertyParameters.errors.txt index 3522a2e50fc9f..1d3ec2da01f39 100644 --- a/tests/baselines/reference/readonlyInNonPropertyParameters.errors.txt +++ b/tests/baselines/reference/readonlyInNonPropertyParameters.errors.txt @@ -1,15 +1,18 @@ tests/cases/compiler/readonlyInNonPropertyParameters.ts(3,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/readonlyInNonPropertyParameters.ts(4,6): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/readonlyInNonPropertyParameters.ts(4,8): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/compiler/readonlyInNonPropertyParameters.ts(6,2): error TS2369: A parameter property is only allowed in a constructor implementation. -==== tests/cases/compiler/readonlyInNonPropertyParameters.ts (3 errors) ==== +==== tests/cases/compiler/readonlyInNonPropertyParameters.ts (4 errors) ==== // `readonly` won't work outside of property parameters class X { method(readonly x: number) {} ~~~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. set x(readonly value: number) {} + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. } diff --git a/tests/baselines/reference/recursiveProperties.errors.txt b/tests/baselines/reference/recursiveProperties.errors.txt new file mode 100644 index 0000000000000..1747d452de44b --- /dev/null +++ b/tests/baselines/reference/recursiveProperties.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/recursiveProperties.ts(6,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/recursiveProperties.ts (1 errors) ==== + class A { + get testProp() { return this.testProp; } + } + + class B { + set testProp(value:string) { this.testProp = value; } + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt b/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt index 2bec20c316a96..1222dd0b762b9 100644 --- a/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt +++ b/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/recursiveSpecializationOfSignatures.ts(2,5): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/recursiveSpecializationOfSignatures.ts(2,5): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/recursiveSpecializationOfSignatures.ts (1 errors) ==== +==== tests/cases/compiler/recursiveSpecializationOfSignatures.ts (2 errors) ==== class S0 { set S1(S2: S0) { ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } constructor(public S17: S0 A>) { } diff --git a/tests/baselines/reference/returnValueInSetter.errors.txt b/tests/baselines/reference/returnValueInSetter.errors.txt index 4d7b0d185f904..b82e2ab9d4cf6 100644 --- a/tests/baselines/reference/returnValueInSetter.errors.txt +++ b/tests/baselines/reference/returnValueInSetter.errors.txt @@ -1,11 +1,14 @@ +tests/cases/compiler/returnValueInSetter.ts(2,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/returnValueInSetter.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/returnValueInSetter.ts(3,9): error TS2408: Setters cannot return a value. -==== tests/cases/compiler/returnValueInSetter.ts (2 errors) ==== +==== tests/cases/compiler/returnValueInSetter.ts (3 errors) ==== class f { set x(value) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; // Should be an error ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/setterWithReturn.errors.txt b/tests/baselines/reference/setterWithReturn.errors.txt index deb0fa6fc3257..e20e3e41db915 100644 --- a/tests/baselines/reference/setterWithReturn.errors.txt +++ b/tests/baselines/reference/setterWithReturn.errors.txt @@ -1,12 +1,15 @@ +tests/cases/compiler/setterWithReturn.ts(2,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/setterWithReturn.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/setterWithReturn.ts(4,13): error TS2408: Setters cannot return a value. tests/cases/compiler/setterWithReturn.ts(7,13): error TS2408: Setters cannot return a value. -==== tests/cases/compiler/setterWithReturn.ts (3 errors) ==== +==== tests/cases/compiler/setterWithReturn.ts (4 errors) ==== class C234 { public set p1(arg1) { ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. if (true) { return arg1; diff --git a/tests/baselines/reference/superPropertyAccess_ES5.errors.txt b/tests/baselines/reference/superPropertyAccess_ES5.errors.txt index 071cfd2372777..2820d52c8550e 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.errors.txt +++ b/tests/baselines/reference/superPropertyAccess_ES5.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superPropertyAccess_ES5.ts(11,22): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword. +tests/cases/compiler/superPropertyAccess_ES5.ts(25,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/superPropertyAccess_ES5.ts(26,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword. -==== tests/cases/compiler/superPropertyAccess_ES5.ts (2 errors) ==== +==== tests/cases/compiler/superPropertyAccess_ES5.ts (3 errors) ==== class MyBase { getValue(): number { return 1; } get value(): number { return 1; } @@ -30,6 +31,8 @@ tests/cases/compiler/superPropertyAccess_ES5.ts(26,15): error TS2340: Only publi class B extends A { set property(value: string) { + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. super.property = value + " addition"; ~~~~~~~~ !!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword. diff --git a/tests/baselines/reference/superPropertyAccess_ES6.errors.txt b/tests/baselines/reference/superPropertyAccess_ES6.errors.txt new file mode 100644 index 0000000000000..bbc9a1a36f830 --- /dev/null +++ b/tests/baselines/reference/superPropertyAccess_ES6.errors.txt @@ -0,0 +1,34 @@ +tests/cases/compiler/superPropertyAccess_ES6.ts(25,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/superPropertyAccess_ES6.ts (1 errors) ==== + class MyBase { + getValue(): number { return 1; } + get value(): number { return 1; } + } + + class MyDerived extends MyBase { + constructor() { + super(); + + const f1 = super.getValue(); + const f2 = super.value; + } + } + + var d = new MyDerived(); + var f3 = d.value; + + class A { + private _property: string; + get property() { return this._property; } + set property(value: string) { this._property = value } + } + + class B extends A { + set property(value: string) { + ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + super.property = value + " addition"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt index d9759c00f6de2..64a3c629d8383 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt +++ b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(5,9): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(9,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,13): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. -==== tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts (3 errors) ==== +==== tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts (4 errors) ==== module M { interface I { } export class C { @@ -19,6 +20,8 @@ tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,13): error TS2 !!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. set [Symbol.toPrimitive](x: I) { } ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~~~~~~~~~~~~~ !!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. } } \ No newline at end of file diff --git a/tests/baselines/reference/symbolDeclarationEmit13.errors.txt b/tests/baselines/reference/symbolDeclarationEmit13.errors.txt new file mode 100644 index 0000000000000..c29efc7c0bff5 --- /dev/null +++ b/tests/baselines/reference/symbolDeclarationEmit13.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts(3,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts (1 errors) ==== + class C { + get [Symbol.toPrimitive]() { return ""; } + set [Symbol.toStringTag](x) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty18.errors.txt b/tests/baselines/reference/symbolProperty18.errors.txt new file mode 100644 index 0000000000000..5b3c703e850f1 --- /dev/null +++ b/tests/baselines/reference/symbolProperty18.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/Symbols/symbolProperty18.ts(4,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/conformance/es6/Symbols/symbolProperty18.ts (1 errors) ==== + var i = { + [Symbol.iterator]: 0, + [Symbol.toStringTag]() { return "" }, + set [Symbol.toPrimitive](p: boolean) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + var it = i[Symbol.iterator]; + var str = i[Symbol.toStringTag](); + i[Symbol.toPrimitive] = false; \ No newline at end of file diff --git a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.errors.txt b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.errors.txt index e0c53c25efcf0..b94c8ce336510 100644 --- a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.errors.txt +++ b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts(5,20): error TS1013: A rest parameter or binding pattern may not have a trailing comma. +tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts(23,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. -==== tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts (1 errors) ==== +==== tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts (2 errors) ==== function f1(x,) {} f1(1,); @@ -27,6 +28,8 @@ tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts(5, constructor(a,) { } // See trailingCommasInGetter.ts set x(value,) { } + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. } interface Y { new(x,); diff --git a/tests/baselines/reference/transformsElideNullUndefinedType.errors.txt b/tests/baselines/reference/transformsElideNullUndefinedType.errors.txt new file mode 100644 index 0000000000000..9fc771c318abb --- /dev/null +++ b/tests/baselines/reference/transformsElideNullUndefinedType.errors.txt @@ -0,0 +1,67 @@ +tests/cases/compiler/transformsElideNullUndefinedType.ts(32,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. +tests/cases/compiler/transformsElideNullUndefinedType.ts(33,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/transformsElideNullUndefinedType.ts (2 errors) ==== + var v0: null; + var v1: undefined; + + function f0(): null { return null; } + function f1(): undefined { return undefined; } + + var f2 = function (): null { return null; } + var f3 = function (): undefined { return undefined; } + + var f4 = (): null => null; + var f5 = (): undefined => undefined; + + function f6(p0: null) { } + function f7(p1: undefined) { } + + var f8 = function (p2: null) { } + var f9 = function (p3: undefined) { } + + var f10 = (p4: null) => { } + var f11 = (p5: undefined) => { } + + class C1 { + m0(): null { return null; } + m1(): undefined { return undefined; } + + m3(p6: null) { } + m4(p7: undefined) { } + + get a0(): null { return null; } + get a1(): undefined { return undefined; } + + set a2(p8: null) { } + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + set a3(p9: undefined) { } + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + } + + class C2 { constructor(p10: null) { } } + class C3 { constructor(p11: undefined) { } } + + class C4 { + f1; + constructor(p12: null) { } + } + + class C5 { + f2; + constructor(p13: undefined) { } + } + + var C6 = class { constructor(p12: null) { } } + var C7 = class { constructor(p13: undefined) { } } + + declare function fn(); + fn(); + fn(); + + declare class D {} + new D(); + new D(); \ No newline at end of file diff --git a/tests/baselines/reference/twoAccessorsWithSameName.errors.txt b/tests/baselines/reference/twoAccessorsWithSameName.errors.txt index 2909db66af132..22c2f866ff162 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName.errors.txt +++ b/tests/baselines/reference/twoAccessorsWithSameName.errors.txt @@ -1,13 +1,15 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(2,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(3,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(7,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(7,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(8,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(8,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(19,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS2300: Duplicate identifier 'x'. -==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts (7 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts (9 errors) ==== class C { get x() { return 1; } ~ @@ -20,9 +22,13 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN class D { set x(v) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS2300: Duplicate identifier 'x'. set x(v) { } // error ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS2300: Duplicate identifier 'x'. } diff --git a/tests/baselines/reference/twoAccessorsWithSameName2.errors.txt b/tests/baselines/reference/twoAccessorsWithSameName2.errors.txt index 59c15d73d5e2c..fe273e0b3e893 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName2.errors.txt +++ b/tests/baselines/reference/twoAccessorsWithSameName2.errors.txt @@ -2,15 +2,17 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(2,16): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(3,16): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(7,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(7,16): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(8,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(8,16): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts (10 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts (12 errors) ==== class C { static get x() { return 1; } ~ @@ -27,11 +29,15 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN class D { static set x(v) { } ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'x'. static set x(v) { } // error ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2300: Duplicate identifier 'x'. diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index 13374b71236ce..ffda91cf2409c 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -45,6 +45,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(103,25 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,9): error TS2322: Type 'true' is not assignable to type 'D'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(106,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(109,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(109,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,9): error TS2408: Setters cannot return a value. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(115,18): error TS1228: A type predicate is only allowed in return type position for functions and methods. @@ -70,7 +71,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,45 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54): error TS2344: Type 'number' does not satisfy the constraint 'Foo'. -==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (56 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (57 errors) ==== class A { ~ !!! error TS2300: Duplicate identifier 'A'. @@ -267,6 +268,8 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 return true; } set m2(p1: A): p1 is C { + ~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~ !!! error TS1228: A type predicate is only allowed in return type position for functions and methods. return true; diff --git a/tests/baselines/reference/typeParametersInStaticAccessors.errors.txt b/tests/baselines/reference/typeParametersInStaticAccessors.errors.txt index 644cd703cdf81..9b91d11ab197a 100644 --- a/tests/baselines/reference/typeParametersInStaticAccessors.errors.txt +++ b/tests/baselines/reference/typeParametersInStaticAccessors.errors.txt @@ -1,10 +1,11 @@ tests/cases/compiler/typeParametersInStaticAccessors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/typeParametersInStaticAccessors.ts(2,29): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/typeParametersInStaticAccessors.ts(3,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/typeParametersInStaticAccessors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/typeParametersInStaticAccessors.ts(3,28): error TS2302: Static members cannot reference class type parameters. -==== tests/cases/compiler/typeParametersInStaticAccessors.ts (4 errors) ==== +==== tests/cases/compiler/typeParametersInStaticAccessors.ts (5 errors) ==== class foo { static get Foo(): () => T { return null; } ~~~ @@ -13,6 +14,8 @@ tests/cases/compiler/typeParametersInStaticAccessors.ts(3,28): error TS2302: Sta !!! error TS2302: Static members cannot reference class type parameters. static set Bar(v: { v: T }) { } ~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ !!! error TS2302: Static members cannot reference class type parameters. diff --git a/tests/baselines/reference/uniqueSymbolsErrors.errors.txt b/tests/baselines/reference/uniqueSymbolsErrors.errors.txt index 3feba130bd60d..cb9e0033174ac 100644 --- a/tests/baselines/reference/uniqueSymbolsErrors.errors.txt +++ b/tests/baselines/reference/uniqueSymbolsErrors.errors.txt @@ -20,6 +20,7 @@ tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(26,40): error tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(27,46): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(28,37): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(29,26): error TS1335: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(30,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(30,28): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(32,12): error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(33,38): error TS1335: 'unique symbol' types are not allowed here. @@ -30,6 +31,7 @@ tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(37,53): error tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(38,59): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(39,50): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(40,39): error TS1335: 'unique symbol' types are not allowed here. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(41,16): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(41,41): error TS1335: 'unique symbol' types are not allowed here. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(46,5): error TS1330: A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'. tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(47,25): error TS1335: 'unique symbol' types are not allowed here. @@ -61,7 +63,7 @@ tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(83,52): error tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(87,7): error TS2322: Type 'unique symbol' is not assignable to type 'string'. -==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts (61 errors) ==== +==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts (63 errors) ==== // declarations declare const invalidUniqueType: unique number; ~~~~~~ @@ -136,6 +138,8 @@ tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(87,7): error T ~~~~~~~~~~~~~ !!! error TS1335: 'unique symbol' types are not allowed here. set invalidSetter(arg: unique symbol) { return; } + ~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~~~~ !!! error TS1335: 'unique symbol' types are not allowed here. @@ -167,6 +171,8 @@ tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsErrors.ts(87,7): error T ~~~~~~~~~~~~~ !!! error TS1335: 'unique symbol' types are not allowed here. static set invalidStaticSetter(arg: unique symbol) { return; } + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~~~~~~~~~~~~~ !!! error TS1335: 'unique symbol' types are not allowed here. } diff --git a/tests/baselines/reference/unusedLocalsAndParameters.errors.txt b/tests/baselines/reference/unusedLocalsAndParameters.errors.txt index 3b7eaa23e22a9..fad80031694e0 100644 --- a/tests/baselines/reference/unusedLocalsAndParameters.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndParameters.errors.txt @@ -4,11 +4,14 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(15,5): error TS6133: 'farrow' tests/cases/compiler/unusedLocalsAndParameters.ts(15,15): error TS6133: 'a' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(18,7): error TS6196: 'C' is declared but never used. tests/cases/compiler/unusedLocalsAndParameters.ts(20,12): error TS6133: 'a' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParameters.ts(23,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParameters.ts(23,11): error TS6133: 'v' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(27,5): error TS6133: 'E' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(29,12): error TS6133: 'a' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParameters.ts(32,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParameters.ts(32,11): error TS6133: 'v' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(38,12): error TS6133: 'a' is declared but its value is never read. +tests/cases/compiler/unusedLocalsAndParameters.ts(41,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParameters.ts(41,11): error TS6133: 'v' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(48,10): error TS6133: 'i' is declared but its value is never read. tests/cases/compiler/unusedLocalsAndParameters.ts(52,10): error TS6133: 'i' is declared but its value is never read. @@ -25,7 +28,7 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(84,6): error TS1005: ',' expec tests/cases/compiler/unusedLocalsAndParameters.ts(85,1): error TS1109: Expression expected. -==== tests/cases/compiler/unusedLocalsAndParameters.ts (25 errors) ==== +==== tests/cases/compiler/unusedLocalsAndParameters.ts (28 errors) ==== export { }; // function declaration paramter @@ -61,6 +64,8 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(85,1): error TS1109: Expressio } // Accessor declaration paramter set x(v: number) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS6133: 'v' is declared but its value is never read. } @@ -76,6 +81,8 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(85,1): error TS1109: Expressio } // Accessor declaration paramter set x(v: number) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS6133: 'v' is declared but its value is never read. } @@ -89,6 +96,8 @@ tests/cases/compiler/unusedLocalsAndParameters.ts(85,1): error TS1109: Expressio }, // Accessor declaration paramter set x(v: number) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. ~ !!! error TS6133: 'v' is declared but its value is never read. } diff --git a/tests/baselines/reference/unusedLocalsAndParametersDeferred.errors.txt b/tests/baselines/reference/unusedLocalsAndParametersDeferred.errors.txt index b35487af3e595..dd88c1a3d8cd7 100644 --- a/tests/baselines/reference/unusedLocalsAndParametersDeferred.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndParametersDeferred.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(41,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(41,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(64,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(64,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(86,9): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(86,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/unusedLocalsAndParametersDeferred.ts (3 errors) ==== +==== tests/cases/compiler/unusedLocalsAndParametersDeferred.ts (6 errors) ==== export { }; function defered(a: () => T): T { @@ -46,6 +49,8 @@ tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(86,9): error TS1056: A // Accessor declaration paramter set x(v: number) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. defered(() => { v; @@ -71,6 +76,8 @@ tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(86,9): error TS1056: A // Accessor declaration paramter set x(v: number) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. defered(() => { v; @@ -95,6 +102,8 @@ tests/cases/compiler/unusedLocalsAndParametersDeferred.ts(86,9): error TS1056: A // Accessor declaration paramter set x(v: number) { ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. defered(() => { v; diff --git a/tests/baselines/reference/unusedPrivateMembers.errors.txt b/tests/baselines/reference/unusedPrivateMembers.errors.txt new file mode 100644 index 0000000000000..e547d01ee067d --- /dev/null +++ b/tests/baselines/reference/unusedPrivateMembers.errors.txt @@ -0,0 +1,54 @@ +tests/cases/compiler/unusedPrivateMembers.ts(31,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + + +==== tests/cases/compiler/unusedPrivateMembers.ts (1 errors) ==== + class Test1 { + private initializeInternal() { + } + + public test() { + var x = new Test1(); + x.initializeInternal(); + } + } + + class Test2 { + private p = 0; + public test() { + var x = new Test2(); + x.p; + } + } + + class Test3 { + private get x () { + return 0; + } + + public test() { + var x = new Test3(); + x.x; + } + } + + class Test4 { + private set x(v) { + ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + v; + } + + public test() { + var x = new Test4(); + x.x; + } + } + + class Test5 { + private p: T; + public test() { + var x = new Test5(); + x.p; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/unusedSetterInClass.errors.txt b/tests/baselines/reference/unusedSetterInClass.errors.txt index d5380cdc1ddca..03bec1c0b529b 100644 --- a/tests/baselines/reference/unusedSetterInClass.errors.txt +++ b/tests/baselines/reference/unusedSetterInClass.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/unusedSetterInClass.ts(2,13): error TS6133: '_fullName' is declared but its value is never read. +tests/cases/compiler/unusedSetterInClass.ts(4,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedSetterInClass.ts(4,17): error TS6133: 'fullName' is declared but its value is never read. -==== tests/cases/compiler/unusedSetterInClass.ts (2 errors) ==== +==== tests/cases/compiler/unusedSetterInClass.ts (3 errors) ==== class Employee { private _fullName: string; ~~~~~~~~~ @@ -10,6 +11,8 @@ tests/cases/compiler/unusedSetterInClass.ts(4,17): error TS6133: 'fullName' is d private set fullName(newName: string) { ~~~~~~~~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~~~~~~~~ !!! error TS6133: 'fullName' is declared but its value is never read. this._fullName = newName; } diff --git a/tests/baselines/reference/unusedSetterInClass2.errors.txt b/tests/baselines/reference/unusedSetterInClass2.errors.txt index c3be0fc0302d9..1c0c26271cba7 100644 --- a/tests/baselines/reference/unusedSetterInClass2.errors.txt +++ b/tests/baselines/reference/unusedSetterInClass2.errors.txt @@ -1,11 +1,14 @@ +tests/cases/compiler/unusedSetterInClass2.ts(3,17): error TS1050: A 'set' accessor must have a corresponding 'get' accessor. tests/cases/compiler/unusedSetterInClass2.ts(3,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/unusedSetterInClass2.ts (1 errors) ==== +==== tests/cases/compiler/unusedSetterInClass2.ts (2 errors) ==== // Unlike everything else, a setter without a getter is used by a write access. class Employee { private set p(_: number) {} ~ +!!! error TS1050: A 'set' accessor must have a corresponding 'get' accessor. + ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. m() {