From 9a771d54e83842dad86e66f604a951b8edf52a0b Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Mon, 7 Aug 2023 13:31:23 -0700 Subject: [PATCH] Skip parent error when reporting excess property checks (#55152) --- src/compiler/checker.ts | 19 +++- .../baselines/reference/arrayCast.errors.txt | 6 +- .../arrayLiteralTypeInference.errors.txt | 24 ++--- .../reference/arrayLiterals.errors.txt | 12 +-- .../reference/assignmentCompatBug2.errors.txt | 18 ++-- .../reference/assignmentCompatBug5.errors.txt | 6 +- .../checkJsdocSatisfiesTag1.errors.txt | 12 +-- .../checkJsdocSatisfiesTag10.errors.txt | 6 +- .../checkJsdocSatisfiesTag12.errors.txt | 12 +-- .../checkJsdocSatisfiesTag13.errors.txt | 6 +- .../checkJsdocSatisfiesTag7.errors.txt | 6 +- .../checkJsdocSatisfiesTag9.errors.txt | 6 +- ...JsdocTypeTagOnExportAssignment1.errors.txt | 6 +- ...JsdocTypeTagOnExportAssignment2.errors.txt | 6 +- ...JsdocTypeTagOnExportAssignment6.errors.txt | 6 +- .../reference/contextualTyping12.errors.txt | 6 +- .../reference/contextualTyping17.errors.txt | 6 +- .../reference/contextualTyping2.errors.txt | 6 +- .../reference/contextualTyping20.errors.txt | 6 +- .../reference/contextualTyping4.errors.txt | 6 +- .../reference/contextualTyping9.errors.txt | 6 +- ...heckingWhenTargetIsIntersection.errors.txt | 12 +-- ...nBaseCallViaSuperPropertyAccess.errors.txt | 6 +- ...structuringParameterProperties5.errors.txt | 6 +- .../discriminatedUnionErrorMessage.errors.txt | 6 +- .../discriminatedUnionTypes2.errors.txt | 6 +- ...sOnUnionsOfOverlappingObjects01.errors.txt | 12 +-- .../excessPropertiesInOverloads.errors.txt | 18 ++++ .../reference/excessPropertiesInOverloads.js | 11 +++ .../excessPropertiesInOverloads.symbols | 18 ++++ .../excessPropertiesInOverloads.types | 22 +++++ ...kIntersectionWithIndexSignature.errors.txt | 6 +- ...ckIntersectionWithRecursiveType.errors.txt | 30 +++---- ...essPropertyCheckWithEmptyObject.errors.txt | 18 ++-- ...yCheckWithMultipleDiscriminants.errors.txt | 48 ++++------ .../excessPropertyCheckWithUnions.errors.txt | 54 ++++-------- ...tyChecksWithNestedIntersections.errors.txt | 36 +++----- ...ssPropertyErrorForFunctionTypes.errors.txt | 6 +- .../genericMappedTypeAsClause.errors.txt | 6 +- .../reference/incompatibleTypes.errors.txt | 18 ++-- .../reference/indexSignatures1.errors.txt | 18 ++-- ...ctDiscriminantAndExcessProperty.errors.txt | 41 +++++++++ .../indirectDiscriminantAndExcessProperty.js | 50 +++++++++++ ...irectDiscriminantAndExcessProperty.symbols | 71 +++++++++++++++ ...ndirectDiscriminantAndExcessProperty.types | 84 ++++++++++++++++++ .../intersectionPropertyCheck.errors.txt | 6 +- ...OrExpressionIsContextuallyTyped.errors.txt | 6 +- .../reference/mappedTypeErrors.errors.txt | 24 ++--- ...LineContextDiagnosticWithPretty.errors.txt | 6 +- .../namespaceImportTypeQuery.errors.txt | 6 +- .../namespaceImportTypeQuery4.errors.txt | 6 +- .../reference/nestedFreshLiteral.errors.txt | 6 +- ...RecursiveArraysOrObjectsError01.errors.txt | 6 +- ...ationEmitErrors1(module=node16).errors.txt | 6 +- ...ionEmitErrors1(module=nodenext).errors.txt | 6 +- ...tUnionNestedExcessPropertyCheck.errors.txt | 18 ++-- .../nonPrimitiveUnionIntersection.errors.txt | 6 +- .../objectLitIndexerContextualType.errors.txt | 6 +- ...objectLitStructuralTypeMismatch.errors.txt | 6 +- .../objectLiteralExcessProperties.errors.txt | 72 +++++---------- ...bjectLiteralFreshnessWithSpread.errors.txt | 6 +- ...eralFunctionArgContextualTyping.errors.txt | 12 +-- ...ralFunctionArgContextualTyping2.errors.txt | 12 +-- ...rthandPropertiesAssignmentError.errors.txt | 6 +- ...nmentErrorFromMissingIdentifier.errors.txt | 6 +- ...attersForSignatureGroupIdentity.errors.txt | 24 ++--- .../reference/propertyAccess.errors.txt | 6 +- ...gSuggestionLeadingUnderscores01.errors.txt | 6 +- .../strictSubtypeAndNarrowing.errors.txt | 18 ++-- .../reference/switchStatements.errors.txt | 6 +- .../reference/symbolProperty21.errors.txt | 6 +- .../thisTypeInFunctionsNegative.errors.txt | 18 ++-- ...el-import-that-changes-with-incremental.js | 22 ++--- ...g-a-deep-multilevel-import-that-changes.js | 3 +- .../export-with-incremental.js | 66 ++++---------- .../no-circular-import/export.js | 9 +- .../exports-with-incremental.js | 66 ++++---------- .../yes-circular-import/exports.js | 9 +- ...el-import-that-changes-with-incremental.js | 88 +++++-------------- ...g-a-deep-multilevel-import-that-changes.js | 12 +-- ...el-import-that-changes-with-incremental.js | 44 +++------- ...g-a-deep-multilevel-import-that-changes.js | 6 +- .../export-with-incremental.js | 44 +++------- .../no-circular-import/export.js | 6 +- .../exports-with-incremental.js | 44 +++------- .../yes-circular-import/exports.js | 6 +- ...el-import-that-changes-with-incremental.js | 44 +++------- ...g-a-deep-multilevel-import-that-changes.js | 6 +- .../export-with-incremental.js | 44 +++------- .../no-circular-import/export.js | 6 +- .../exports-with-incremental.js | 44 +++------- .../yes-circular-import/exports.js | 6 +- ...el-import-that-changes-with-incremental.js | 44 +++------- ...g-a-deep-multilevel-import-that-changes.js | 6 +- .../export-with-incremental.js | 44 +++------- .../no-circular-import/export.js | 6 +- .../exports-with-incremental.js | 44 +++------- .../yes-circular-import/exports.js | 6 +- ...el-import-that-changes-with-incremental.js | 44 +++------- ...g-a-deep-multilevel-import-that-changes.js | 6 +- .../export-with-incremental.js | 44 +++------- .../no-circular-import/export.js | 6 +- .../exports-with-incremental.js | 44 +++------- .../yes-circular-import/exports.js | 6 +- ...UsesConstraintOnCircularDefault.errors.txt | 6 +- .../typeArgumentInference.errors.txt | 6 +- ...entInferenceConstructSignatures.errors.txt | 6 +- ...rgumentInferenceWithConstraints.errors.txt | 6 +- .../typeFromPropertyAssignment28.errors.txt | 6 +- .../baselines/reference/typeInfer1.errors.txt | 6 +- .../baselines/reference/typeMatch2.errors.txt | 18 ++-- .../reference/typeSatisfaction.errors.txt | 12 +-- ...tisfaction_propNameConstraining.errors.txt | 6 +- ...faction_propertyNameFulfillment.errors.txt | 6 +- ...ction_propertyValueConformance3.errors.txt | 6 +- .../compiler/excessPropertiesInOverloads.ts | 5 ++ .../indirectDiscriminantAndExcessProperty.ts | 25 ++++++ 117 files changed, 855 insertions(+), 1236 deletions(-) create mode 100644 tests/baselines/reference/excessPropertiesInOverloads.errors.txt create mode 100644 tests/baselines/reference/excessPropertiesInOverloads.js create mode 100644 tests/baselines/reference/excessPropertiesInOverloads.symbols create mode 100644 tests/baselines/reference/excessPropertiesInOverloads.types create mode 100644 tests/baselines/reference/indirectDiscriminantAndExcessProperty.errors.txt create mode 100644 tests/baselines/reference/indirectDiscriminantAndExcessProperty.js create mode 100644 tests/baselines/reference/indirectDiscriminantAndExcessProperty.symbols create mode 100644 tests/baselines/reference/indirectDiscriminantAndExcessProperty.types create mode 100644 tests/cases/compiler/excessPropertiesInOverloads.ts create mode 100644 tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ae9ea3ec04165..8fc9359fa370b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20369,6 +20369,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { let expandingFlags = ExpandingFlags.None; let overflow = false; let overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid + let skipParentCounter = 0; // How many errors should be skipped 'above' in the elaboration pyramid let lastSkippedInfo: [Type, Type] | undefined; let incompatibleStack: DiagnosticAndArguments[] | undefined; @@ -20430,6 +20431,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { lastSkippedInfo = saved.lastSkippedInfo; incompatibleStack = saved.incompatibleStack; overrideNextErrorInfo = saved.overrideNextErrorInfo; + skipParentCounter = saved.skipParentCounter; relatedInfo = saved.relatedInfo; } @@ -20439,6 +20441,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { lastSkippedInfo, incompatibleStack: incompatibleStack?.slice(), overrideNextErrorInfo, + skipParentCounter, relatedInfo: relatedInfo?.slice() as [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined, }; } @@ -20561,7 +20564,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { Debug.assert(!!errorNode); if (incompatibleStack) reportIncompatibleStack(); if (message.elidedInCompatabilityPyramid) return; - errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); + if (skipParentCounter === 0) { + errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); + } + else { + skipParentCounter--; + } + } + + function reportParentSkippedError(message: DiagnosticMessage, ...args: DiagnosticArguments): void { + reportError(message, ...args); + skipParentCounter++; } function associateRelatedInfo(info: DiagnosticRelatedInformation) { @@ -20958,11 +20971,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } if (suggestion !== undefined) { - reportError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion); } else { - reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); } } diff --git a/tests/baselines/reference/arrayCast.errors.txt b/tests/baselines/reference/arrayCast.errors.txt index e45e3c8daabf3..950c35269731f 100644 --- a/tests/baselines/reference/arrayCast.errors.txt +++ b/tests/baselines/reference/arrayCast.errors.txt @@ -1,6 +1,5 @@ arrayCast.ts(3,23): error TS2352: Conversion of type '{ foo: string; }[]' to type '{ id: number; }[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type '{ foo: string; }' is not comparable to type '{ id: number; }'. - Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'. + Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'. ==== arrayCast.ts (1 errors) ==== @@ -9,8 +8,7 @@ arrayCast.ts(3,23): error TS2352: Conversion of type '{ foo: string; }[]' to typ <{ id: number; }[]>[{ foo: "s" }]; ~~~ !!! error TS2352: Conversion of type '{ foo: string; }[]' to type '{ id: number; }[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Type '{ foo: string; }' is not comparable to type '{ id: number; }'. -!!! error TS2352: Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'. +!!! error TS2352: Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'. // Should succeed, as the {} element causes the type of the array to be {}[] <{ id: number; }[]>[{ foo: "s" }, {}]; \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt index b93d7243fe4fe..c30590f70707a 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt +++ b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt @@ -1,11 +1,7 @@ -arrayLiteralTypeInference.ts(14,14): error TS2322: Type '{ id: number; trueness: false; }' is not assignable to type 'Action'. - Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. -arrayLiteralTypeInference.ts(15,14): error TS2322: Type '{ id: number; name: string; }' is not assignable to type 'Action'. - Object literal may only specify known properties, and 'name' does not exist in type 'Action'. -arrayLiteralTypeInference.ts(31,18): error TS2322: Type '{ id: number; trueness: false; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. -arrayLiteralTypeInference.ts(32,18): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +arrayLiteralTypeInference.ts(14,14): error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. +arrayLiteralTypeInference.ts(15,14): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'Action'. +arrayLiteralTypeInference.ts(31,18): error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. +arrayLiteralTypeInference.ts(32,18): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== arrayLiteralTypeInference.ts (4 errors) ==== @@ -24,12 +20,10 @@ arrayLiteralTypeInference.ts(32,18): error TS2322: Type '{ id: number; name: str var x1: Action[] = [ { id: 2, trueness: false }, ~~~~~~~~ -!!! error TS2322: Type '{ id: number; trueness: false; }' is not assignable to type 'Action'. -!!! error TS2322: Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. +!!! error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. { id: 3, name: "three" } ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type 'Action'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type 'Action'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'Action'. ] var x2: Action[] = [ @@ -47,12 +41,10 @@ arrayLiteralTypeInference.ts(32,18): error TS2322: Type '{ id: number; name: str [ { id: 2, trueness: false }, ~~~~~~~~ -!!! error TS2322: Type '{ id: number; trueness: false; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. { id: 3, name: "three" } ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ] var z2: { id: number }[] = diff --git a/tests/baselines/reference/arrayLiterals.errors.txt b/tests/baselines/reference/arrayLiterals.errors.txt index a4e089933e072..715df255793ad 100644 --- a/tests/baselines/reference/arrayLiterals.errors.txt +++ b/tests/baselines/reference/arrayLiterals.errors.txt @@ -1,7 +1,5 @@ -arrayLiterals.ts(24,77): error TS2322: Type '{ a: string; b: number; c: string; }' is not assignable to type '{ a: string; b: number; }'. - Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. -arrayLiterals.ts(24,101): error TS2322: Type '{ a: string; b: number; c: number; }' is not assignable to type '{ a: string; b: number; }'. - Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. +arrayLiterals.ts(24,77): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. +arrayLiterals.ts(24,101): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. ==== arrayLiterals.ts (2 errors) ==== @@ -30,12 +28,10 @@ arrayLiterals.ts(24,101): error TS2322: Type '{ a: string; b: number; c: number; // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ~ -!!! error TS2322: Type '{ a: string; b: number; c: string; }' is not assignable to type '{ a: string; b: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. !!! related TS6501 arrayLiterals.ts:24:17: The expected type comes from this index signature. ~ -!!! error TS2322: Type '{ a: string; b: number; c: number; }' is not assignable to type '{ a: string; b: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. !!! related TS6501 arrayLiterals.ts:24:17: The expected type comes from this index signature. var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 6d1e0ffd492d5..fd93992e9c81a 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,9 +1,6 @@ -assignmentCompatBug2.ts(1,27): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. - Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. -assignmentCompatBug2.ts(3,8): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. - Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. -assignmentCompatBug2.ts(5,13): error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. - Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +assignmentCompatBug2.ts(1,27): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +assignmentCompatBug2.ts(3,8): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +assignmentCompatBug2.ts(5,13): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. assignmentCompatBug2.ts(15,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. assignmentCompatBug2.ts(20,1): error TS2741: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. @@ -12,18 +9,15 @@ assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ ==== assignmentCompatBug2.ts (6 errors) ==== var b2: { b: number;} = { a: 0 }; // error ~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. b2 = { a: 0 }; // error ~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. b2 = {b: 0, a: 0 }; ~ -!!! error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }; diff --git a/tests/baselines/reference/assignmentCompatBug5.errors.txt b/tests/baselines/reference/assignmentCompatBug5.errors.txt index 49f5755490708..66909866116d3 100644 --- a/tests/baselines/reference/assignmentCompatBug5.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -1,5 +1,4 @@ -assignmentCompatBug5.ts(2,8): error TS2345: Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. - Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. +assignmentCompatBug5.ts(2,8): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. assignmentCompatBug5.ts(5,7): error TS2322: Type 'string' is not assignable to type 'number'. assignmentCompatBug5.ts(5,12): error TS2322: Type 'string' is not assignable to type 'number'. assignmentCompatBug5.ts(8,6): error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. @@ -13,8 +12,7 @@ assignmentCompatBug5.ts(9,6): error TS2345: Argument of type '(n: number) => voi function foo1(x: { a: number; }) { } foo1({ b: 5 }); ~ -!!! error TS2345: Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. -!!! error TS2345: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. function foo2(x: number[]) { } foo2(["s", "t"]); diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag1.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag1.errors.txt index 78798d222df24..f6e157468658d 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag1.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag1.errors.txt @@ -1,9 +1,7 @@ -/a.js(21,44): error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'T1'. - Object literal may only specify known properties, and 'b' does not exist in type 'T1'. +/a.js(21,44): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. /a.js(22,17): error TS1360: Type '{}' does not satisfy the expected type 'T1'. Property 'a' is missing in type '{}' but required in type 'T1'. -/a.js(31,49): error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'T4'. - Object literal may only specify known properties, and 'b' does not exist in type 'T4'. +/a.js(31,49): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T4'. ==== /a.js (3 errors) ==== @@ -29,8 +27,7 @@ const t1 = /** @satisfies {T1} */ ({ a: 1 }); const t2 = /** @satisfies {T1} */ ({ a: 1, b: 1 }); ~ -!!! error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'T1'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. const t3 = /** @satisfies {T1} */ ({}); ~~~~~~~~~ !!! error TS1360: Type '{}' does not satisfy the expected type 'T1'. @@ -46,6 +43,5 @@ const t7 = /** @satisfies {T4} */ ({ a: 'test' }); const t8 = /** @satisfies {T4} */ ({ a: 'test', b: 'test' }); ~ -!!! error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'T4'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'T4'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T4'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag10.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag10.errors.txt index c5bc9c2d7e8b0..4b23f0cb689bf 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag10.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag10.errors.txt @@ -1,5 +1,4 @@ -/a.js(6,5): error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Partial>'. - Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. +/a.js(6,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. /a.js(14,11): error TS2339: Property 'd' does not exist on type '{ a: number; b: string; x: number; }'. @@ -11,8 +10,7 @@ b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' ~ -!!! error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Partial>'. -!!! error TS1360: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. }); // Should be OK -- retain info that a is number and b is string diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag12.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag12.errors.txt index 5d34c70e3e11a..f49984e64e9a1 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag12.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag12.errors.txt @@ -1,7 +1,5 @@ -/a.js(24,20): error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'T1'. - Object literal may only specify known properties, and 'b' does not exist in type 'T1'. -/a.js(44,25): error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'T2'. - Object literal may only specify known properties, and 'b' does not exist in type 'T2'. +/a.js(24,20): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. +/a.js(44,25): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T2'. /a.js(51,6): error TS1360: Type 'number' does not satisfy the expected type 'string'. @@ -31,8 +29,7 @@ */ const t2 = { a: 1, b: 1 }; ~ -!!! error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'T1'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T1'. /** * @satisfies {T1} @@ -54,8 +51,7 @@ */ const t6 = { a: 'test', b: 'test' }; ~ -!!! error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'T2'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'T2'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'T2'. /** * @satisfies {T3} diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag13.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag13.errors.txt index 581ece2d4f2b3..7359596ff3b64 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag13.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag13.errors.txt @@ -1,5 +1,4 @@ -/a.js(5,14): error TS1360: Type '{ g: string; }' does not satisfy the expected type '{ f: (x: string) => string; }'. - Object literal may only specify known properties, and 'g' does not exist in type '{ f: (x: string) => string; }'. +/a.js(5,14): error TS2353: Object literal may only specify known properties, and 'g' does not exist in type '{ f: (x: string) => string; }'. ==== /a.js (1 errors) ==== @@ -9,6 +8,5 @@ /** @satisfies {{ f: (x: string) => string }} */ const t2 = { g: "oops" }; // should error ~ -!!! error TS1360: Type '{ g: string; }' does not satisfy the expected type '{ f: (x: string) => string; }'. -!!! error TS1360: Object literal may only specify known properties, and 'g' does not exist in type '{ f: (x: string) => string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'g' does not exist in type '{ f: (x: string) => string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag7.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag7.errors.txt index 14b2a71d92989..509ca8498bac4 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag7.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag7.errors.txt @@ -1,5 +1,4 @@ -/a.js(6,5): error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Record'. - Object literal may only specify known properties, and 'x' does not exist in type 'Record'. +/a.js(6,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. /a.js(14,11): error TS2339: Property 'd' does not exist on type '{ a: number; b: string; x: number; }'. @@ -11,8 +10,7 @@ b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' ~ -!!! error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Record'. -!!! error TS1360: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. }) // Should be OK -- retain info that a is number and b is string diff --git a/tests/baselines/reference/checkJsdocSatisfiesTag9.errors.txt b/tests/baselines/reference/checkJsdocSatisfiesTag9.errors.txt index 34b7bfefacd0c..41ef78bd2430a 100644 --- a/tests/baselines/reference/checkJsdocSatisfiesTag9.errors.txt +++ b/tests/baselines/reference/checkJsdocSatisfiesTag9.errors.txt @@ -1,5 +1,4 @@ -/a.js(11,26): error TS2322: Type '{ r: number; g: number; d: number; }' is not assignable to type 'Color'. - Object literal may only specify known properties, and 'd' does not exist in type 'Color'. +/a.js(11,26): error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. ==== /a.js (1 errors) ==== @@ -15,8 +14,7 @@ white: { r: 255, g: 255, b: 255 }, black: { r: 0, g: 0, d: 0 }, // <- oops! 'd' in place of 'b' ~ -!!! error TS2322: Type '{ r: number; g: number; d: number; }' is not assignable to type 'Color'. -!!! error TS2322: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. +!!! error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. blue: { r: 0, g: 0, b: 255 }, }); \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.errors.txt b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.errors.txt index 42b3a6b5ecab7..80bf4e5488e77 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.errors.txt @@ -1,5 +1,4 @@ -a.js(8,18): error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo'. - Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +a.js(8,18): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== checkJsdocTypeTagOnExportAssignment1.js (0 errors) ==== @@ -14,8 +13,7 @@ a.js(8,18): error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo' /** @type {Foo} */ export default { c: false }; ~ -!!! error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== b.js (0 errors) ==== import a from "./a"; diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.errors.txt b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.errors.txt index faa2fbccec9d9..7ad65b7a41260 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.errors.txt @@ -1,5 +1,4 @@ -b.js(2,18): error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo'. - Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +b.js(2,18): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== checkJsdocTypeTagOnExportAssignment2.js (0 errors) ==== @@ -14,8 +13,7 @@ b.js(2,18): error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo' /** @type {import("./a").Foo} */ export default { c: false }; ~ -!!! error TS2322: Type '{ c: boolean; }' is not assignable to type 'Foo'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== c.js (0 errors) ==== import b from "./b"; diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.errors.txt b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.errors.txt index f725c913f8732..319b9dc4fc471 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.errors.txt @@ -1,5 +1,4 @@ -a.js(8,30): error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Foo'. - Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +a.js(8,30): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== checkJsdocTypeTagOnExportAssignment6.js (0 errors) ==== @@ -14,8 +13,7 @@ a.js(8,30): error TS2322: Type '{ a: number; b: number; c: number; }' is not ass /** @type {Foo} */ export default { a: 1, b: 1, c: 1 }; ~ -!!! error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Foo'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Foo'. ==== b.js (0 errors) ==== import a from "./a"; diff --git a/tests/baselines/reference/contextualTyping12.errors.txt b/tests/baselines/reference/contextualTyping12.errors.txt index b2ca0370ba930..b4385995db678 100644 --- a/tests/baselines/reference/contextualTyping12.errors.txt +++ b/tests/baselines/reference/contextualTyping12.errors.txt @@ -1,9 +1,7 @@ -contextualTyping12.ts(1,57): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping12.ts(1,57): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping12.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping17.errors.txt b/tests/baselines/reference/contextualTyping17.errors.txt index f058295acf1b7..934fc5a52b5e3 100644 --- a/tests/baselines/reference/contextualTyping17.errors.txt +++ b/tests/baselines/reference/contextualTyping17.errors.txt @@ -1,9 +1,7 @@ -contextualTyping17.ts(1,47): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping17.ts(1,47): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping17.ts (1 errors) ==== var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping2.errors.txt b/tests/baselines/reference/contextualTyping2.errors.txt index f6466a97960cc..ad67a7f31ecda 100644 --- a/tests/baselines/reference/contextualTyping2.errors.txt +++ b/tests/baselines/reference/contextualTyping2.errors.txt @@ -1,9 +1,7 @@ -contextualTyping2.ts(1,32): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping2.ts(1,32): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping2.ts (1 errors) ==== var foo: {id:number;} = {id:4, name:"foo"}; ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping20.errors.txt b/tests/baselines/reference/contextualTyping20.errors.txt index 1bf5567e9b27e..6e3cff5fef266 100644 --- a/tests/baselines/reference/contextualTyping20.errors.txt +++ b/tests/baselines/reference/contextualTyping20.errors.txt @@ -1,9 +1,7 @@ -contextualTyping20.ts(1,58): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping20.ts(1,58): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping20.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping4.errors.txt b/tests/baselines/reference/contextualTyping4.errors.txt index 371edc063ed79..16f5e5a075505 100644 --- a/tests/baselines/reference/contextualTyping4.errors.txt +++ b/tests/baselines/reference/contextualTyping4.errors.txt @@ -1,9 +1,7 @@ -contextualTyping4.ts(1,46): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping4.ts(1,46): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping4.ts (1 errors) ==== class foo { public bar:{id:number;} = {id:5, name:"foo"}; } ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping9.errors.txt b/tests/baselines/reference/contextualTyping9.errors.txt index a5d9ba889d0ce..3f1e9a36cc88e 100644 --- a/tests/baselines/reference/contextualTyping9.errors.txt +++ b/tests/baselines/reference/contextualTyping9.errors.txt @@ -1,9 +1,7 @@ -contextualTyping9.ts(1,42): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. +contextualTyping9.ts(1,42): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== contextualTyping9.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; ~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.errors.txt b/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.errors.txt index 54b6ea9f2d581..993263507396d 100644 --- a/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.errors.txt +++ b/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.errors.txt @@ -1,7 +1,5 @@ -deepExcessPropertyCheckingWhenTargetIsIntersection.ts(21,33): error TS2322: Type '{ INVALID_PROP_NAME: string; ariaLabel: string; }' is not assignable to type 'ITestProps'. - Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. -deepExcessPropertyCheckingWhenTargetIsIntersection.ts(27,34): error TS2322: Type '{ INVALID_PROP_NAME: string; ariaLabel: string; }' is not assignable to type 'ITestProps'. - Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. +deepExcessPropertyCheckingWhenTargetIsIntersection.ts(21,33): error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. +deepExcessPropertyCheckingWhenTargetIsIntersection.ts(27,34): error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. ==== deepExcessPropertyCheckingWhenTargetIsIntersection.ts (2 errors) ==== @@ -27,8 +25,7 @@ deepExcessPropertyCheckingWhenTargetIsIntersection.ts(27,34): error TS2322: Type TestComponent({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }}); ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ INVALID_PROP_NAME: string; ariaLabel: string; }' is not assignable to type 'ITestProps'. -!!! error TS2322: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. +!!! error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. !!! related TS6500 deepExcessPropertyCheckingWhenTargetIsIntersection.ts:14:3: The expected type comes from property 'props' which is declared here on type 'NestedProp' const TestComponent2: StatelessComponent = (props) => { @@ -37,7 +34,6 @@ deepExcessPropertyCheckingWhenTargetIsIntersection.ts(27,34): error TS2322: Type TestComponent2({icon: { props: { INVALID_PROP_NAME: 'share', ariaLabel: 'test label' } }}); ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ INVALID_PROP_NAME: string; ariaLabel: string; }' is not assignable to type 'ITestProps'. -!!! error TS2322: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. +!!! error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'ITestProps'. !!! related TS6500 deepExcessPropertyCheckingWhenTargetIsIntersection.ts:14:3: The expected type comes from property 'props' which is declared here on type 'NestedProp' \ No newline at end of file diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt index a39405b274699..5bdddf98060fe 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt @@ -1,5 +1,4 @@ -derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts(14,36): error TS2345: Argument of type '{ a: number; b: number; }' is not assignable to parameter of type '{ a: number; }'. - Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. +derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts(14,36): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. ==== derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts (1 errors) ==== @@ -18,8 +17,7 @@ derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts(14,36): error TS2345: var r = super.foo({ a: 1 }); // { a: number } var r2 = super.foo({ a: 1, b: 2 }); // { a: number } ~ -!!! error TS2345: Argument of type '{ a: number; b: number; }' is not assignable to parameter of type '{ a: number; }'. -!!! error TS2345: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } } } \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterProperties5.errors.txt b/tests/baselines/reference/destructuringParameterProperties5.errors.txt index 4fdd0a3041d42..320ff1f1091ff 100644 --- a/tests/baselines/reference/destructuringParameterProperties5.errors.txt +++ b/tests/baselines/reference/destructuringParameterProperties5.errors.txt @@ -7,8 +7,7 @@ destructuringParameterProperties5.ts(7,40): error TS2339: Property 'x2' does not destructuringParameterProperties5.ts(7,51): error TS2339: Property 'x3' does not exist on type 'C1'. destructuringParameterProperties5.ts(7,62): error TS2339: Property 'y' does not exist on type 'C1'. destructuringParameterProperties5.ts(7,72): error TS2339: Property 'z' does not exist on type 'C1'. -destructuringParameterProperties5.ts(11,19): error TS2322: Type '{ x1: number; x2: string; x3: true; }' is not assignable to type 'ObjType1'. - Object literal may only specify known properties, and 'x1' does not exist in type 'ObjType1'. +destructuringParameterProperties5.ts(11,19): error TS2353: Object literal may only specify known properties, and 'x1' does not exist in type 'ObjType1'. destructuringParameterProperties5.ts(11,47): error TS2322: Type 'string' is not assignable to type 'number'. destructuringParameterProperties5.ts(11,51): error TS2322: Type 'boolean' is not assignable to type 'string'. destructuringParameterProperties5.ts(12,39): error TS2339: Property 'x1' does not exist on type 'C1'. @@ -49,8 +48,7 @@ destructuringParameterProperties5.ts(12,62): error TS2339: Property 'z' does not var a = new C1([{ x1: 10, x2: "", x3: true }, "", false]); ~~ -!!! error TS2322: Type '{ x1: number; x2: string; x3: true; }' is not assignable to type 'ObjType1'. -!!! error TS2322: Object literal may only specify known properties, and 'x1' does not exist in type 'ObjType1'. +!!! error TS2353: Object literal may only specify known properties, and 'x1' does not exist in type 'ObjType1'. ~~ !!! error TS2322: Type 'string' is not assignable to type 'number'. ~~~~~ diff --git a/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt b/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt index af5b2d8026191..4153875f9e6c6 100644 --- a/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt +++ b/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt @@ -1,5 +1,4 @@ -discriminatedUnionErrorMessage.ts(10,5): error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. - Object literal may only specify known properties, and 'x' does not exist in type 'Square'. +discriminatedUnionErrorMessage.ts(10,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Square'. ==== discriminatedUnionErrorMessage.ts (1 errors) ==== @@ -14,8 +13,7 @@ discriminatedUnionErrorMessage.ts(10,5): error TS2322: Type '{ kind: "sq"; x: nu kind: "sq", x: 12, ~ -!!! error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. -!!! error TS2322: Object literal may only specify known properties, and 'x' does not exist in type 'Square'. +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Square'. y: 13, } \ No newline at end of file diff --git a/tests/baselines/reference/discriminatedUnionTypes2.errors.txt b/tests/baselines/reference/discriminatedUnionTypes2.errors.txt index 4b68384a53c2a..be69c9aa43f0a 100644 --- a/tests/baselines/reference/discriminatedUnionTypes2.errors.txt +++ b/tests/baselines/reference/discriminatedUnionTypes2.errors.txt @@ -1,5 +1,4 @@ -discriminatedUnionTypes2.ts(27,30): error TS2322: Type '{ a: null; b: string; c: number; }' is not assignable to type '{ a: null; b: string; } | { a: string; c: number; }'. - Object literal may only specify known properties, and 'c' does not exist in type '{ a: null; b: string; }'. +discriminatedUnionTypes2.ts(27,30): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: null; b: string; }'. discriminatedUnionTypes2.ts(32,11): error TS2339: Property 'b' does not exist on type '{ a: 0; b: string; } | { a: T; c: number; }'. Property 'b' does not exist on type '{ a: T; c: number; }'. @@ -33,8 +32,7 @@ discriminatedUnionTypes2.ts(32,11): error TS2339: Property 'b' does not exist on function f13(x: { a: null; b: string } | { a: string, c: number }) { x = { a: null, b: "foo", c: 4}; // Error ~ -!!! error TS2322: Type '{ a: null; b: string; c: number; }' is not assignable to type '{ a: null; b: string; } | { a: string; c: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type '{ a: null; b: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: null; b: string; }'. } function f14(x: { a: 0; b: string } | { a: T, c: number }) { diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt index c130496ca7d18..d60d21a076d41 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt @@ -3,14 +3,12 @@ errorsOnUnionsOfOverlappingObjects01.ts(18,3): error TS2345: Argument of type '{ Types of property 'b' are incompatible. Type 'string' is not assignable to type 'number'. errorsOnUnionsOfOverlappingObjects01.ts(19,12): error TS2322: Type 'string' is not assignable to type 'number'. -errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. - Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. +errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. errorsOnUnionsOfOverlappingObjects01.ts(42,10): error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'. Property 'cat' is missing in type '{ dog: string; }' but required in type 'CatDog'. errorsOnUnionsOfOverlappingObjects01.ts(43,10): error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'. Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'. -errorsOnUnionsOfOverlappingObjects01.ts(46,26): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. - Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. +errorsOnUnionsOfOverlappingObjects01.ts(46,26): error TS2353: Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. Type '{ man: string; beer: string; }' is missing the following properties from type 'ManBearPig': bear, pig @@ -48,8 +46,7 @@ errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS2345: Argument of type ' g(x); g({ a: '', b: '' }) ~ -!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. -!!! error TS2345: Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. declare function h(x: Foo | Bar | Other): any; @@ -81,8 +78,7 @@ errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS2345: Argument of type ' const manBeer = { man: "Manny", beer: "Coffee" }; addToZoo({ man: "Manny", beer: "Coffee" }); ~~~~ -!!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. -!!! error TS2345: Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. +!!! error TS2353: Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. addToZoo(manBeer); ~~~~~~~ !!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. diff --git a/tests/baselines/reference/excessPropertiesInOverloads.errors.txt b/tests/baselines/reference/excessPropertiesInOverloads.errors.txt new file mode 100644 index 0000000000000..c82442e350d24 --- /dev/null +++ b/tests/baselines/reference/excessPropertiesInOverloads.errors.txt @@ -0,0 +1,18 @@ +excessPropertiesInOverloads.ts(3,6): error TS2769: No overload matches this call. + Overload 1 of 2, '(a: { x: string; }): void', gave the following error. + Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. + Overload 2 of 2, '(a: { y: string; }): void', gave the following error. + Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. + + +==== excessPropertiesInOverloads.ts (1 errors) ==== + declare function fn(a: { x: string }): void; + declare function fn(a: { y: string }): void; + fn({ z: 3, a: 3 }); + ~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(a: { x: string; }): void', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. +!!! error TS2769: Overload 2 of 2, '(a: { y: string; }): void', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertiesInOverloads.js b/tests/baselines/reference/excessPropertiesInOverloads.js new file mode 100644 index 0000000000000..90927062e3def --- /dev/null +++ b/tests/baselines/reference/excessPropertiesInOverloads.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/excessPropertiesInOverloads.ts] //// + +//// [excessPropertiesInOverloads.ts] +declare function fn(a: { x: string }): void; +declare function fn(a: { y: string }): void; +fn({ z: 3, a: 3 }); + + +//// [excessPropertiesInOverloads.js] +"use strict"; +fn({ z: 3, a: 3 }); diff --git a/tests/baselines/reference/excessPropertiesInOverloads.symbols b/tests/baselines/reference/excessPropertiesInOverloads.symbols new file mode 100644 index 0000000000000..8e86b29bbf428 --- /dev/null +++ b/tests/baselines/reference/excessPropertiesInOverloads.symbols @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/excessPropertiesInOverloads.ts] //// + +=== excessPropertiesInOverloads.ts === +declare function fn(a: { x: string }): void; +>fn : Symbol(fn, Decl(excessPropertiesInOverloads.ts, 0, 0), Decl(excessPropertiesInOverloads.ts, 0, 44)) +>a : Symbol(a, Decl(excessPropertiesInOverloads.ts, 0, 20)) +>x : Symbol(x, Decl(excessPropertiesInOverloads.ts, 0, 24)) + +declare function fn(a: { y: string }): void; +>fn : Symbol(fn, Decl(excessPropertiesInOverloads.ts, 0, 0), Decl(excessPropertiesInOverloads.ts, 0, 44)) +>a : Symbol(a, Decl(excessPropertiesInOverloads.ts, 1, 20)) +>y : Symbol(y, Decl(excessPropertiesInOverloads.ts, 1, 24)) + +fn({ z: 3, a: 3 }); +>fn : Symbol(fn, Decl(excessPropertiesInOverloads.ts, 0, 0), Decl(excessPropertiesInOverloads.ts, 0, 44)) +>z : Symbol(z, Decl(excessPropertiesInOverloads.ts, 2, 4)) +>a : Symbol(a, Decl(excessPropertiesInOverloads.ts, 2, 10)) + diff --git a/tests/baselines/reference/excessPropertiesInOverloads.types b/tests/baselines/reference/excessPropertiesInOverloads.types new file mode 100644 index 0000000000000..5e2e31562ff85 --- /dev/null +++ b/tests/baselines/reference/excessPropertiesInOverloads.types @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/excessPropertiesInOverloads.ts] //// + +=== excessPropertiesInOverloads.ts === +declare function fn(a: { x: string }): void; +>fn : { (a: { x: string;}): void; (a: { y: string; }): void; } +>a : { x: string; } +>x : string + +declare function fn(a: { y: string }): void; +>fn : { (a: { x: string; }): void; (a: { y: string;}): void; } +>a : { y: string; } +>y : string + +fn({ z: 3, a: 3 }); +>fn({ z: 3, a: 3 }) : void +>fn : { (a: { x: string; }): void; (a: { y: string; }): void; } +>{ z: 3, a: 3 } : { z: number; a: number; } +>z : number +>3 : 3 +>a : number +>3 : 3 + diff --git a/tests/baselines/reference/excessPropertyCheckIntersectionWithIndexSignature.errors.txt b/tests/baselines/reference/excessPropertyCheckIntersectionWithIndexSignature.errors.txt index 73c5e940e60b8..5ba106305efb6 100644 --- a/tests/baselines/reference/excessPropertyCheckIntersectionWithIndexSignature.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckIntersectionWithIndexSignature.errors.txt @@ -1,7 +1,6 @@ excessPropertyCheckIntersectionWithIndexSignature.ts(5,7): error TS2322: Type '{ a: 0; }' is not assignable to type '{ a: 0; } & { b: 0; }'. Property 'b' is missing in type '{ a: 0; }' but required in type '{ b: 0; }'. -excessPropertyCheckIntersectionWithIndexSignature.ts(7,24): error TS2322: Type '{ a: 0; b: 0; c: number; }' is not assignable to type '{ a: 0; } & { b: 0; }'. - Object literal may only specify known properties, and 'c' does not exist in type '{ a: 0; } & { b: 0; }'. +excessPropertyCheckIntersectionWithIndexSignature.ts(7,24): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: 0; } & { b: 0; }'. ==== excessPropertyCheckIntersectionWithIndexSignature.ts (2 errors) ==== @@ -17,8 +16,7 @@ excessPropertyCheckIntersectionWithIndexSignature.ts(7,24): error TS2322: Type ' x = { y: { a: 0, b: 0 } }; x = { y: { a: 0, b: 0, c: 0 } }; // Error ~ -!!! error TS2322: Type '{ a: 0; b: 0; c: number; }' is not assignable to type '{ a: 0; } & { b: 0; }'. -!!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type '{ a: 0; } & { b: 0; }'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type '{ a: 0; } & { b: 0; }'. type A = { a: string }; type B = { b: string }; diff --git a/tests/baselines/reference/excessPropertyCheckIntersectionWithRecursiveType.errors.txt b/tests/baselines/reference/excessPropertyCheckIntersectionWithRecursiveType.errors.txt index 6aa2fc71ac903..faf11254bbc04 100644 --- a/tests/baselines/reference/excessPropertyCheckIntersectionWithRecursiveType.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckIntersectionWithRecursiveType.errors.txt @@ -1,13 +1,8 @@ -excessPropertyCheckIntersectionWithRecursiveType.ts(13,9): error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: Schema1; }'. - Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. - Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(39,9): error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: Schema3; }'. - Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. - Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(86,11): error TS2322: Type '{ name: string; children: { name: string; children: { name: string; }[]; }[]; }' is not assignable to type 'User'. - Object literal may only specify known properties, and 'children' does not exist in type 'User'. +excessPropertyCheckIntersectionWithRecursiveType.ts(13,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(39,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(86,11): error TS2353: Object literal may only specify known properties, and 'children' does not exist in type 'User'. excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Property 'children' does not exist on type 'User'. @@ -26,8 +21,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: Schema1; }'. -!!! error TS2322: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. !!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:6:65: The expected type comes from property 'props' which is declared here on type 'Schema1<{ l2: boolean; }>' }, }, @@ -43,8 +37,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -!!! error TS2322: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. !!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:19:78: The expected type comes from property 'props' which is declared here on type '{ props: { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; } & Example<{ l2: boolean; }>' }, }, @@ -60,8 +53,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type '{ l2: Schema3; }'. -!!! error TS2322: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. !!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:32:78: The expected type comes from property 'props' which is declared here on type 'Schema3<{ l2: boolean; }>' }, }, @@ -77,8 +69,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2322: Type '{ l2: { type: "boolean"; }; invalid: false; }' is not assignable to type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -!!! error TS2322: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. !!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:45:78: The expected type comes from property 'props' which is declared here on type '{ props: Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; }' }, }, @@ -115,8 +106,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope name: "Grand son", children: [ ~~~~~~~~ -!!! error TS2322: Type '{ name: string; children: { name: string; children: { name: string; }[]; }[]; }' is not assignable to type 'User'. -!!! error TS2322: Object literal may only specify known properties, and 'children' does not exist in type 'User'. +!!! error TS2353: Object literal may only specify known properties, and 'children' does not exist in type 'User'. { name: "123", children: [ diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt index 34f95a5f33ada..330bfeaafd771 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt @@ -1,9 +1,6 @@ -excessPropertyCheckWithEmptyObject.ts(4,58): error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. - Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. -excessPropertyCheckWithEmptyObject.ts(9,30): error TS2322: Type '{ y: number; }' is not assignable to type 'A & ThisType'. - Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType'. -excessPropertyCheckWithEmptyObject.ts(14,34): error TS2322: Type '{ y: string; }' is not assignable to type 'Empty & { x: number; }'. - Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'. +excessPropertyCheckWithEmptyObject.ts(4,58): error TS2353: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. +excessPropertyCheckWithEmptyObject.ts(9,30): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType'. +excessPropertyCheckWithEmptyObject.ts(14,34): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'. ==== excessPropertyCheckWithEmptyObject.ts (3 errors) ==== @@ -12,22 +9,19 @@ excessPropertyCheckWithEmptyObject.ts(14,34): error TS2322: Type '{ y: string; } // Excess property error expected here Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); ~~~~~~~~ -!!! error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. -!!! error TS2345: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. +!!! error TS2353: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. interface A { x?: string } // Excess property error expected here let a: A & ThisType = { y: 10 }; ~ -!!! error TS2322: Type '{ y: number; }' is not assignable to type 'A & ThisType'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType'. interface Empty {} // Excess property error expected here let x: Empty & { x: number } = { y: "hello" }; ~ -!!! error TS2322: Type '{ y: string; }' is not assignable to type 'Empty & { x: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithMultipleDiscriminants.errors.txt b/tests/baselines/reference/excessPropertyCheckWithMultipleDiscriminants.errors.txt index 3e81790a33481..1bffdedd51fdd 100644 --- a/tests/baselines/reference/excessPropertyCheckWithMultipleDiscriminants.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithMultipleDiscriminants.errors.txt @@ -1,19 +1,11 @@ -excessPropertyCheckWithMultipleDiscriminants.ts(30,5): error TS2322: Type '{ type: "number"; value: number; multipleOf: number; format: string; }' is not assignable to type 'Primitive'. - Object literal may only specify known properties, and 'multipleOf' does not exist in type 'Float'. -excessPropertyCheckWithMultipleDiscriminants.ts(41,5): error TS2322: Type '{ p1: "left"; p2: false; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. - Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. -excessPropertyCheckWithMultipleDiscriminants.ts(50,5): error TS2322: Type '{ p1: "left"; p2: true; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. - Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. -excessPropertyCheckWithMultipleDiscriminants.ts(57,5): error TS2322: Type '{ p1: "right"; p2: false; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. - Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. -excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2322: Type '{ type: "A"; n: number; a: number; b: number; }' is not assignable to type 'CommonWithOverlappingOptionals'. - Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. -excessPropertyCheckWithMultipleDiscriminants.ts(93,5): error TS2322: Type '{ type: "A"; n: number; a: number; b: number; }' is not assignable to type 'CommonWithDisjointOverlappingOptionals'. - Object literal may only specify known properties, and 'b' does not exist in type 'Common | A'. -excessPropertyCheckWithMultipleDiscriminants.ts(131,5): error TS2322: Type '{ type: "string"; autoIncrement: boolean; required: true; }' is not assignable to type 'Attribute'. - Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute | OneToOneAttribute'. -excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ type: "string"; autoIncrement: boolean; required: true; }' is not assignable to type 'Attribute2'. - Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. +excessPropertyCheckWithMultipleDiscriminants.ts(30,5): error TS2353: Object literal may only specify known properties, and 'multipleOf' does not exist in type 'Float'. +excessPropertyCheckWithMultipleDiscriminants.ts(41,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. +excessPropertyCheckWithMultipleDiscriminants.ts(50,5): error TS2353: Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. +excessPropertyCheckWithMultipleDiscriminants.ts(57,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. +excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. +excessPropertyCheckWithMultipleDiscriminants.ts(93,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | A'. +excessPropertyCheckWithMultipleDiscriminants.ts(131,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute | OneToOneAttribute'. +excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. ==== excessPropertyCheckWithMultipleDiscriminants.ts (8 errors) ==== @@ -48,8 +40,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty value: 10, multipleOf: 5, // excess property ~~~~~~~~~~ -!!! error TS2322: Type '{ type: "number"; value: number; multipleOf: number; format: string; }' is not assignable to type 'Primitive'. -!!! error TS2322: Object literal may only specify known properties, and 'multipleOf' does not exist in type 'Float'. +!!! error TS2353: Object literal may only specify known properties, and 'multipleOf' does not exist in type 'Float'. format: "what?" } @@ -62,8 +53,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty p2: false, p3: 42, ~~ -!!! error TS2322: Type '{ p1: "left"; p2: false; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. -!!! error TS2322: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. +!!! error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. p4: "hello" }; @@ -74,8 +64,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty p3: 42, p4: "hello" ~~ -!!! error TS2322: Type '{ p1: "left"; p2: true; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. -!!! error TS2322: Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. +!!! error TS2353: Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. }; // This has excess error because variant two is the only applicable case @@ -84,8 +73,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty p2: false, p3: 42, ~~ -!!! error TS2322: Type '{ p1: "right"; p2: false; p3: number; p4: string; }' is not assignable to type 'DisjointDiscriminants'. -!!! error TS2322: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. p4: "hello" }; @@ -113,8 +101,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty a: 1, b: 1 // excess property ~ -!!! error TS2322: Type '{ type: "A"; n: number; a: number; b: number; }' is not assignable to type 'CommonWithOverlappingOptionals'. -!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. } type CommonWithDisjointOverlappingOptionals = Common | A | B; @@ -126,8 +113,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty a: 1, b: 1 // excess property ~ -!!! error TS2322: Type '{ type: "A"; n: number; a: number; b: number; }' is not assignable to type 'CommonWithDisjointOverlappingOptionals'. -!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type 'Common | A'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | A'. } // Repro from https://github.com/microsoft/TypeScript/pull/51884#issuecomment-1472736068 @@ -167,8 +153,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty type: 'string', autoIncrement: true, ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ type: "string"; autoIncrement: boolean; required: true; }' is not assignable to type 'Attribute'. -!!! error TS2322: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute | OneToOneAttribute'. +!!! error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute | OneToOneAttribute'. required: true, }; @@ -176,8 +161,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2322: Type '{ ty type: 'string', autoIncrement: true, ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ type: "string"; autoIncrement: boolean; required: true; }' is not assignable to type 'Attribute2'. -!!! error TS2322: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. +!!! error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. required: true, }; \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt index dd3850a347292..019f93a873b64 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -1,28 +1,19 @@ -excessPropertyCheckWithUnions.ts(10,30): error TS2322: Type '{ tag: "T"; a1: string; }' is not assignable to type 'ADT'. - Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. -excessPropertyCheckWithUnions.ts(11,21): error TS2322: Type '{ tag: "A"; d20: number; }' is not assignable to type 'ADT'. - Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. +excessPropertyCheckWithUnions.ts(10,30): error TS2353: Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. +excessPropertyCheckWithUnions.ts(11,21): error TS2353: Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. excessPropertyCheckWithUnions.ts(12,1): error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. Property 'd20' is missing in type '{ tag: "D"; }' but required in type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. -excessPropertyCheckWithUnions.ts(33,28): error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. - Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. -excessPropertyCheckWithUnions.ts(34,26): error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. - Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +excessPropertyCheckWithUnions.ts(33,28): error TS2353: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +excessPropertyCheckWithUnions.ts(34,26): error TS2353: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. excessPropertyCheckWithUnions.ts(37,1): error TS2322: Type '{ tag: "A"; }' is not assignable to type 'Ambiguous'. Type '{ tag: "A"; }' is not assignable to type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. Property 'y' is missing in type '{ tag: "A"; }' but required in type '{ tag: "A"; y: number; }'. -excessPropertyCheckWithUnions.ts(38,19): error TS2322: Type '{ tag: "A"; z: boolean; }' is not assignable to type 'Ambiguous'. - Object literal may only specify known properties, and 'z' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. -excessPropertyCheckWithUnions.ts(47,35): error TS2322: Type '{ a: 1; b: 1; first: string; second: string; }' is not assignable to type 'Overlapping'. - Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. -excessPropertyCheckWithUnions.ts(48,35): error TS2322: Type '{ a: 1; b: 1; first: string; third: string; }' is not assignable to type 'Overlapping'. - Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. +excessPropertyCheckWithUnions.ts(38,19): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +excessPropertyCheckWithUnions.ts(47,35): error TS2353: Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. +excessPropertyCheckWithUnions.ts(48,35): error TS2353: Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. excessPropertyCheckWithUnions.ts(64,9): error TS2322: Type '{ kind: "A"; n: { a: string; b: string; }; }' is not assignable to type 'AB'. Types of property 'n' are incompatible. - Type '{ a: string; b: string; }' is not assignable to type 'AN'. - Object literal may only specify known properties, and 'b' does not exist in type 'AN'. -excessPropertyCheckWithUnions.ts(85,5): error TS2322: Type '{ tag: "button"; type: "submit"; href: string; }' is not assignable to type 'Union'. - Object literal may only specify known properties, and 'href' does not exist in type 'Button'. + Object literal may only specify known properties, and 'b' does not exist in type 'AN'. +excessPropertyCheckWithUnions.ts(85,5): error TS2353: Object literal may only specify known properties, and 'href' does not exist in type 'Button'. excessPropertyCheckWithUnions.ts(106,5): error TS2322: Type 'string' is not assignable to type 'IValue'. excessPropertyCheckWithUnions.ts(111,67): error TS2322: Type 'string' is not assignable to type 'number'. excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not assignable to type 'number'. @@ -40,12 +31,10 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass } let wrong: ADT = { tag: "T", a1: "extra" } ~~ -!!! error TS2322: Type '{ tag: "T"; a1: string; }' is not assignable to type 'ADT'. -!!! error TS2322: Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. +!!! error TS2353: Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. wrong = { tag: "A", d20: 12 } ~~~ -!!! error TS2322: Type '{ tag: "A"; d20: number; }' is not assignable to type 'ADT'. -!!! error TS2322: Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. wrong = { tag: "D" } ~~~~~ !!! error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. @@ -73,12 +62,10 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass // correctly error on excess property 'extra', even when ambiguous amb = { tag: "A", x: "hi", extra: 12 } ~~~~~ -!!! error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. -!!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. amb = { tag: "A", y: 12, extra: 12 } ~~~~~ -!!! error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. -!!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'extra' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. // assignability errors still work amb = { tag: "A" } @@ -89,8 +76,7 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass !!! related TS2728 excessPropertyCheckWithUnions.ts:19:5: 'y' is declared here. amb = { tag: "A", z: true } ~ -!!! error TS2322: Type '{ tag: "A"; z: boolean; }' is not assignable to type 'Ambiguous'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ tag: "A"; x: string; } | { tag: "A"; y: number; }'. type Overlapping = | { a: 1, b: 1, first: string } @@ -101,12 +87,10 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass // these two are still errors despite their doubled up discriminants over = { a: 1, b: 1, first: "ok", second: "error" } ~~~~~~ -!!! error TS2322: Type '{ a: 1; b: 1; first: string; second: string; }' is not assignable to type 'Overlapping'. -!!! error TS2322: Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. over = { a: 1, b: 1, first: "ok", third: "error" } ~~~~~ -!!! error TS2322: Type '{ a: 1; b: 1; first: string; third: string; }' is not assignable to type 'Overlapping'. -!!! error TS2322: Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. // Freshness disappears after spreading a union declare let t0: { a: any, b: any } | { d: any, e: any } @@ -126,8 +110,7 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass ~ !!! error TS2322: Type '{ kind: "A"; n: { a: string; b: string; }; }' is not assignable to type 'AB'. !!! error TS2322: Types of property 'n' are incompatible. -!!! error TS2322: Type '{ a: string; b: string; }' is not assignable to type 'AN'. -!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type 'AN'. +!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type 'AN'. } } const abac: AB = { @@ -150,8 +133,7 @@ excessPropertyCheckWithUnions.ts(112,63): error TS2322: Type 'string' is not ass // should have error here href: 'foo', ~~~~ -!!! error TS2322: Type '{ tag: "button"; type: "submit"; href: string; }' is not assignable to type 'Union'. -!!! error TS2322: Object literal may only specify known properties, and 'href' does not exist in type 'Button'. +!!! error TS2353: Object literal may only specify known properties, and 'href' does not exist in type 'Button'. }; // Repro from #34611 diff --git a/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.errors.txt b/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.errors.txt index b4947e7372fd3..e64ed94294d79 100644 --- a/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.errors.txt +++ b/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.errors.txt @@ -1,17 +1,11 @@ excessPropertyChecksWithNestedIntersections.ts(18,19): error TS2322: Type 'number' is not assignable to type 'string'. -excessPropertyChecksWithNestedIntersections.ts(19,31): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'A'. - Object literal may only specify known properties, and 'y' does not exist in type 'A'. +excessPropertyChecksWithNestedIntersections.ts(19,31): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A'. excessPropertyChecksWithNestedIntersections.ts(22,19): error TS2322: Type 'number' is not assignable to type 'string'. -excessPropertyChecksWithNestedIntersections.ts(23,31): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'A'. - Object literal may only specify known properties, and 'y' does not exist in type 'A'. -excessPropertyChecksWithNestedIntersections.ts(34,5): error TS2322: Type '{ id: number; url: string; xyz: number; }' is not assignable to type '{ id: number; } & { url: string; }'. - Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. -excessPropertyChecksWithNestedIntersections.ts(43,9): error TS2322: Type '{ id: number; url: string; xyz: number; }' is not assignable to type '{ id: number; } & { url: string; }'. - Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. -excessPropertyChecksWithNestedIntersections.ts(68,32): error TS2322: Type '{ foo: true; bar: true; boo: boolean; }' is not assignable to type 'View'. - Object literal may only specify known properties, and 'boo' does not exist in type 'View'. -excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo: true; bar: true; boo: true; }' is not assignable to type 'boolean | View'. - Object literal may only specify known properties, and 'boo' does not exist in type 'View'. +excessPropertyChecksWithNestedIntersections.ts(23,31): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A'. +excessPropertyChecksWithNestedIntersections.ts(34,5): error TS2353: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. +excessPropertyChecksWithNestedIntersections.ts(43,9): error TS2353: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. +excessPropertyChecksWithNestedIntersections.ts(68,32): error TS2353: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. +excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2353: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. ==== excessPropertyChecksWithNestedIntersections.ts (8 errors) ==== @@ -38,8 +32,7 @@ excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:4:5: The expected type comes from property 'x' which is declared here on type 'A' let c: B = { a: { x: 'hello', y: 2 } }; // error - y does not exist in type A ~ -!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'A'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'A'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A'. !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:8:5: The expected type comes from property 'a' which is declared here on type 'B' let d: D = { a: { x: 'hello' }, c: 5 }; // ok @@ -49,8 +42,7 @@ excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:4:5: The expected type comes from property 'x' which is declared here on type 'A' let f: D = { a: { x: 'hello', y: 2 }, c: 5 }; // error - y does not exist in type A ~ -!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'A'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'A'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A'. !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:8:5: The expected type comes from property 'a' which is declared here on type 'D' // https://github.com/Microsoft/TypeScript/issues/18075 @@ -64,8 +56,7 @@ excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo url: '', xyz: 1 // Great! This causes an error! ~~~ -!!! error TS2322: Type '{ id: number; url: string; xyz: number; }' is not assignable to type '{ id: number; } & { url: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. }; export const myInstance: MyType = { @@ -76,8 +67,7 @@ excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo url: '', xyz: 2 // This should also be an error ~~~ -!!! error TS2322: Type '{ id: number; url: string; xyz: number; }' is not assignable to type '{ id: number; } & { url: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'xyz' does not exist in type '{ id: number; } & { url: string; }'. !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:27:62: The expected type comes from property 'photo' which is declared here on type 'MyType' } }; @@ -105,12 +95,10 @@ excessPropertyChecksWithNestedIntersections.ts(70,50): error TS2322: Type '{ foo test = { foo: true, bar: true, boo: true } ~~~ -!!! error TS2322: Type '{ foo: true; bar: true; boo: boolean; }' is not assignable to type 'View'. -!!! error TS2322: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. +!!! error TS2353: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. test = { foo: true, bar: { foo: true, bar: true, boo: true } } ~~~ -!!! error TS2322: Type '{ foo: true; bar: true; boo: true; }' is not assignable to type 'boolean | View'. -!!! error TS2322: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. +!!! error TS2353: Object literal may only specify known properties, and 'boo' does not exist in type 'View'. !!! related TS6500 excessPropertyChecksWithNestedIntersections.ts:63:5: The expected type comes from property 'bar' which is declared here on type 'View' \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt index 6c3f0b9610e29..3788c6d8907b1 100644 --- a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt +++ b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt @@ -1,5 +1,4 @@ -excessPropertyErrorForFunctionTypes.ts(4,44): error TS2322: Type '{ a: number; c: number; d: number; }' is not assignable to type 'DoesntWork'. - Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. +excessPropertyErrorForFunctionTypes.ts(4,44): error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. ==== excessPropertyErrorForFunctionTypes.ts (1 errors) ==== @@ -8,5 +7,4 @@ excessPropertyErrorForFunctionTypes.ts(4,44): error TS2322: Type '{ a: number; c let doesntWork: DoesntWork = { a: 1, c: 2, d: 3 } ~ -!!! error TS2322: Type '{ a: number; c: number; d: number; }' is not assignable to type 'DoesntWork'. -!!! error TS2322: Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. \ No newline at end of file diff --git a/tests/baselines/reference/genericMappedTypeAsClause.errors.txt b/tests/baselines/reference/genericMappedTypeAsClause.errors.txt index cf1ef415e4d26..e6161cbb37c19 100644 --- a/tests/baselines/reference/genericMappedTypeAsClause.errors.txt +++ b/tests/baselines/reference/genericMappedTypeAsClause.errors.txt @@ -3,8 +3,7 @@ genericMappedTypeAsClause.ts(14,11): error TS2322: Type 'number' is not assignab genericMappedTypeAsClause.ts(15,11): error TS2322: Type 'string' is not assignable to type 'MappedModel'. genericMappedTypeAsClause.ts(16,11): error TS2322: Type 'number[]' is not assignable to type 'MappedModel'. genericMappedTypeAsClause.ts(17,11): error TS2322: Type 'boolean' is not assignable to type 'MappedModel'. -genericMappedTypeAsClause.ts(18,34): error TS2322: Type '{ a: string; b: number; }' is not assignable to type 'MappedModel'. - Object literal may only specify known properties, and 'a' does not exist in type 'MappedModel'. +genericMappedTypeAsClause.ts(18,34): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type 'MappedModel'. genericMappedTypeAsClause.ts(19,11): error TS2322: Type 'undefined' is not assignable to type 'MappedModel'. genericMappedTypeAsClause.ts(25,60): error TS2312: An interface can only extend an object type or intersection of object types with statically known members. @@ -40,8 +39,7 @@ genericMappedTypeAsClause.ts(25,60): error TS2312: An interface can only extend !!! error TS2322: Type 'boolean' is not assignable to type 'MappedModel'. const x5: MappedModel = { a: 'bar', b: 42 }; // Error ~ -!!! error TS2322: Type '{ a: string; b: number; }' is not assignable to type 'MappedModel'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type 'MappedModel'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type 'MappedModel'. const x6: MappedModel = undefined; // Error ~~ !!! error TS2322: Type 'undefined' is not assignable to type 'MappedModel'. diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index cc1722433ad61..8d48f0173ee42 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -20,13 +20,10 @@ incompatibleTypes.ts(42,5): error TS2769: No overload matches this call. Type 'string' is not assignable to type 'number'. incompatibleTypes.ts(49,7): error TS2769: No overload matches this call. Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. - Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. - Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. -incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. - Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. + Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +incompatibleTypes.ts(66,47): error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. Target signature provides too few arguments. Expected 1 or more, but got 0. @@ -111,11 +108,9 @@ incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assig ~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. -!!! error TS2769: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. -!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. !!! error TS2769: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. -!!! error TS2769: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. -!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. !!! related TS2793 incompatibleTypes.ts:47:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. interface IMap { @@ -135,8 +130,7 @@ incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assig var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; ~ -!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; diff --git a/tests/baselines/reference/indexSignatures1.errors.txt b/tests/baselines/reference/indexSignatures1.errors.txt index 637b0c22a08b8..ae9b07b65cec9 100644 --- a/tests/baselines/reference/indexSignatures1.errors.txt +++ b/tests/baselines/reference/indexSignatures1.errors.txt @@ -5,8 +5,7 @@ indexSignatures1.ts(21,5): error TS2322: Type 'IY' is not assignable to type 'IX Index signature for type '`a${string}`' is missing in type 'IY'. indexSignatures1.ts(42,12): error TS7053: Element implicitly has an 'any' type because expression of type '"axxxbbbyc"' can't be used to index type '{ [x: `${string}xxx${string}` & `${string}yyy${string}`]: string; }'. Property 'axxxbbbyc' does not exist on type '{ [x: `${string}xxx${string}` & `${string}yyy${string}`]: string; }'. -indexSignatures1.ts(53,9): error TS2322: Type '{ date123: string; }' is not assignable to type '{ [x: `data${string}`]: string; }'. - Object literal may only specify known properties, and 'date123' does not exist in type '{ [x: `data${string}`]: string; }'. +indexSignatures1.ts(53,9): error TS2353: Object literal may only specify known properties, and 'date123' does not exist in type '{ [x: `data${string}`]: string; }'. indexSignatures1.ts(70,5): error TS2374: Duplicate index signature for type 'number'. indexSignatures1.ts(71,5): error TS2374: Duplicate index signature for type 'number'. indexSignatures1.ts(71,5): error TS2374: Duplicate index signature for type 'symbol'. @@ -64,12 +63,10 @@ indexSignatures1.ts(181,1): error TS7053: Element implicitly has an 'any' type b indexSignatures1.ts(182,1): error TS7053: Element implicitly has an 'any' type because expression of type 'TaggedString2' can't be used to index type '{ [key: string & Tag1 & Tag2]: string; }'. indexSignatures1.ts(183,1): error TS7053: Element implicitly has an 'any' type because expression of type 'TaggedString1 | TaggedString2' can't be used to index type '{ [key: string & Tag1 & Tag2]: string; }'. indexSignatures1.ts(277,7): error TS2322: Type '"&"' is not assignable to type '`&:${string}`'. -indexSignatures1.ts(281,35): error TS2322: Type '{ someKey: string; }' is not assignable to type 'PseudoDeclaration'. - Object literal may only specify known properties, and ''someKey'' does not exist in type 'PseudoDeclaration'. +indexSignatures1.ts(281,35): error TS2353: Object literal may only specify known properties, and ''someKey'' does not exist in type 'PseudoDeclaration'. indexSignatures1.ts(286,7): error TS2322: Type '"two"' is not assignable to type '`/${string}`'. indexSignatures1.ts(289,7): error TS2322: Type 'number' is not assignable to type 'PathsObject'. -indexSignatures1.ts(312,43): error TS2322: Type '{ [sym]: string; }' is not assignable to type '{ [key: number]: string; }'. - Object literal may only specify known properties, and '[sym]' does not exist in type '{ [key: number]: string; }'. +indexSignatures1.ts(312,43): error TS2353: Object literal may only specify known properties, and '[sym]' does not exist in type '{ [key: number]: string; }'. ==== indexSignatures1.ts (50 errors) ==== @@ -137,8 +134,7 @@ indexSignatures1.ts(312,43): error TS2322: Type '{ [sym]: string; }' is not assi dom = { data123: 'hello' }; dom = { date123: 'hello' }; // Error ~~~~~~~ -!!! error TS2322: Type '{ date123: string; }' is not assignable to type '{ [x: `data${string}`]: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'date123' does not exist in type '{ [x: `data${string}`]: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'date123' does not exist in type '{ [x: `data${string}`]: string; }'. // Contextual typing by index signature with template literal pattern @@ -467,8 +463,7 @@ indexSignatures1.ts(312,43): error TS2322: Type '{ [sym]: string; }' is not assi const test: PseudoDeclaration = { 'someKey' : 'someValue' }; // Error ~~~~~~~~~ -!!! error TS2322: Type '{ someKey: string; }' is not assignable to type 'PseudoDeclaration'. -!!! error TS2322: Object literal may only specify known properties, and ''someKey'' does not exist in type 'PseudoDeclaration'. +!!! error TS2353: Object literal may only specify known properties, and ''someKey'' does not exist in type 'PseudoDeclaration'. type FieldPattern = `/${string}`; @@ -505,8 +500,7 @@ indexSignatures1.ts(312,43): error TS2322: Type '{ [sym]: string; }' is not assi const obj2: { [key: string]: string } = { [sym]: 'hello '}; // Permitted for backwards compatibility const obj3: { [key: number]: string } = { [sym]: 'hello '}; // Error ~~~~~ -!!! error TS2322: Type '{ [sym]: string; }' is not assignable to type '{ [key: number]: string; }'. -!!! error TS2322: Object literal may only specify known properties, and '[sym]' does not exist in type '{ [key: number]: string; }'. +!!! error TS2353: Object literal may only specify known properties, and '[sym]' does not exist in type '{ [key: number]: string; }'. // Repro from #45772 diff --git a/tests/baselines/reference/indirectDiscriminantAndExcessProperty.errors.txt b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.errors.txt new file mode 100644 index 0000000000000..b14efcd6305d0 --- /dev/null +++ b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.errors.txt @@ -0,0 +1,41 @@ +indirectDiscriminantAndExcessProperty.ts(9,5): error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. +indirectDiscriminantAndExcessProperty.ts(15,5): error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. +indirectDiscriminantAndExcessProperty.ts(22,5): error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. + + +==== indirectDiscriminantAndExcessProperty.ts (3 errors) ==== + export type Blah = + | { type: "foo", abc: string } + | { type: "bar", xyz: number, extra: any }; + + declare function thing(blah: Blah): void; + + let foo1 = "foo"; + thing({ + type: foo1, + ~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. +!!! related TS6500 indirectDiscriminantAndExcessProperty.ts:2:9: The expected type comes from property 'type' which is declared here on type 'Blah' + abc: "hello!" + }); + + let foo2 = "foo"; + thing({ + type: foo2, + ~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. +!!! related TS6500 indirectDiscriminantAndExcessProperty.ts:2:9: The expected type comes from property 'type' which is declared here on type 'Blah' + abc: "hello!", + extra: 123, + }); + + let bar = "bar"; + thing({ + type: bar, + ~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. +!!! related TS6500 indirectDiscriminantAndExcessProperty.ts:2:9: The expected type comes from property 'type' which is declared here on type 'Blah' + xyz: 123, + extra: 123, + }); + \ No newline at end of file diff --git a/tests/baselines/reference/indirectDiscriminantAndExcessProperty.js b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.js new file mode 100644 index 0000000000000..b506b5750ab46 --- /dev/null +++ b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.js @@ -0,0 +1,50 @@ +//// [tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts] //// + +//// [indirectDiscriminantAndExcessProperty.ts] +export type Blah = + | { type: "foo", abc: string } + | { type: "bar", xyz: number, extra: any }; + +declare function thing(blah: Blah): void; + +let foo1 = "foo"; +thing({ + type: foo1, + abc: "hello!" +}); + +let foo2 = "foo"; +thing({ + type: foo2, + abc: "hello!", + extra: 123, +}); + +let bar = "bar"; +thing({ + type: bar, + xyz: 123, + extra: 123, +}); + + +//// [indirectDiscriminantAndExcessProperty.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var foo1 = "foo"; +thing({ + type: foo1, + abc: "hello!" +}); +var foo2 = "foo"; +thing({ + type: foo2, + abc: "hello!", + extra: 123, +}); +var bar = "bar"; +thing({ + type: bar, + xyz: 123, + extra: 123, +}); diff --git a/tests/baselines/reference/indirectDiscriminantAndExcessProperty.symbols b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.symbols new file mode 100644 index 0000000000000..15cb41dc4d747 --- /dev/null +++ b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.symbols @@ -0,0 +1,71 @@ +//// [tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts] //// + +=== indirectDiscriminantAndExcessProperty.ts === +export type Blah = +>Blah : Symbol(Blah, Decl(indirectDiscriminantAndExcessProperty.ts, 0, 0)) + + | { type: "foo", abc: string } +>type : Symbol(type, Decl(indirectDiscriminantAndExcessProperty.ts, 1, 7)) +>abc : Symbol(abc, Decl(indirectDiscriminantAndExcessProperty.ts, 1, 20)) + + | { type: "bar", xyz: number, extra: any }; +>type : Symbol(type, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 7)) +>xyz : Symbol(xyz, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 20)) +>extra : Symbol(extra, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 33)) + +declare function thing(blah: Blah): void; +>thing : Symbol(thing, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 47)) +>blah : Symbol(blah, Decl(indirectDiscriminantAndExcessProperty.ts, 4, 23)) +>Blah : Symbol(Blah, Decl(indirectDiscriminantAndExcessProperty.ts, 0, 0)) + +let foo1 = "foo"; +>foo1 : Symbol(foo1, Decl(indirectDiscriminantAndExcessProperty.ts, 6, 3)) + +thing({ +>thing : Symbol(thing, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 47)) + + type: foo1, +>type : Symbol(type, Decl(indirectDiscriminantAndExcessProperty.ts, 7, 7)) +>foo1 : Symbol(foo1, Decl(indirectDiscriminantAndExcessProperty.ts, 6, 3)) + + abc: "hello!" +>abc : Symbol(abc, Decl(indirectDiscriminantAndExcessProperty.ts, 8, 15)) + +}); + +let foo2 = "foo"; +>foo2 : Symbol(foo2, Decl(indirectDiscriminantAndExcessProperty.ts, 12, 3)) + +thing({ +>thing : Symbol(thing, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 47)) + + type: foo2, +>type : Symbol(type, Decl(indirectDiscriminantAndExcessProperty.ts, 13, 7)) +>foo2 : Symbol(foo2, Decl(indirectDiscriminantAndExcessProperty.ts, 12, 3)) + + abc: "hello!", +>abc : Symbol(abc, Decl(indirectDiscriminantAndExcessProperty.ts, 14, 15)) + + extra: 123, +>extra : Symbol(extra, Decl(indirectDiscriminantAndExcessProperty.ts, 15, 18)) + +}); + +let bar = "bar"; +>bar : Symbol(bar, Decl(indirectDiscriminantAndExcessProperty.ts, 19, 3)) + +thing({ +>thing : Symbol(thing, Decl(indirectDiscriminantAndExcessProperty.ts, 2, 47)) + + type: bar, +>type : Symbol(type, Decl(indirectDiscriminantAndExcessProperty.ts, 20, 7)) +>bar : Symbol(bar, Decl(indirectDiscriminantAndExcessProperty.ts, 19, 3)) + + xyz: 123, +>xyz : Symbol(xyz, Decl(indirectDiscriminantAndExcessProperty.ts, 21, 14)) + + extra: 123, +>extra : Symbol(extra, Decl(indirectDiscriminantAndExcessProperty.ts, 22, 13)) + +}); + diff --git a/tests/baselines/reference/indirectDiscriminantAndExcessProperty.types b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.types new file mode 100644 index 0000000000000..491d0be152850 --- /dev/null +++ b/tests/baselines/reference/indirectDiscriminantAndExcessProperty.types @@ -0,0 +1,84 @@ +//// [tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts] //// + +=== indirectDiscriminantAndExcessProperty.ts === +export type Blah = +>Blah : { type: "foo"; abc: string; } | { type: "bar"; xyz: number; extra: any; } + + | { type: "foo", abc: string } +>type : "foo" +>abc : string + + | { type: "bar", xyz: number, extra: any }; +>type : "bar" +>xyz : number +>extra : any + +declare function thing(blah: Blah): void; +>thing : (blah: Blah) => void +>blah : Blah + +let foo1 = "foo"; +>foo1 : string +>"foo" : "foo" + +thing({ +>thing({ type: foo1, abc: "hello!"}) : void +>thing : (blah: Blah) => void +>{ type: foo1, abc: "hello!"} : { type: string; abc: string; } + + type: foo1, +>type : string +>foo1 : string + + abc: "hello!" +>abc : string +>"hello!" : "hello!" + +}); + +let foo2 = "foo"; +>foo2 : string +>"foo" : "foo" + +thing({ +>thing({ type: foo2, abc: "hello!", extra: 123,}) : void +>thing : (blah: Blah) => void +>{ type: foo2, abc: "hello!", extra: 123,} : { type: string; abc: string; extra: number; } + + type: foo2, +>type : string +>foo2 : string + + abc: "hello!", +>abc : string +>"hello!" : "hello!" + + extra: 123, +>extra : number +>123 : 123 + +}); + +let bar = "bar"; +>bar : string +>"bar" : "bar" + +thing({ +>thing({ type: bar, xyz: 123, extra: 123,}) : void +>thing : (blah: Blah) => void +>{ type: bar, xyz: 123, extra: 123,} : { type: string; xyz: number; extra: number; } + + type: bar, +>type : string +>bar : string + + xyz: 123, +>xyz : number +>123 : 123 + + extra: 123, +>extra : number +>123 : 123 + +}); + diff --git a/tests/baselines/reference/intersectionPropertyCheck.errors.txt b/tests/baselines/reference/intersectionPropertyCheck.errors.txt index 0ccf2f0ec534c..023539bd7b2e6 100644 --- a/tests/baselines/reference/intersectionPropertyCheck.errors.txt +++ b/tests/baselines/reference/intersectionPropertyCheck.errors.txt @@ -1,5 +1,4 @@ -intersectionPropertyCheck.ts(1,68): error TS2322: Type '{ x: string; y: number; }' is not assignable to type '{ x: string; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; }'. +intersectionPropertyCheck.ts(1,68): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; }'. intersectionPropertyCheck.ts(4,5): error TS2322: Type '{ a: { y: string; }; }' is not assignable to type '{ a?: { x?: number | undefined; } | undefined; } & { c?: string | undefined; }'. Types of property 'a' are incompatible. Type '{ y: string; }' has no properties in common with type '{ x?: number | undefined; }'. @@ -12,8 +11,7 @@ intersectionPropertyCheck.ts(17,22): error TS2322: Type 'boolean' is not assigna ==== intersectionPropertyCheck.ts (4 errors) ==== let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property ~ -!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type '{ x: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; }'. !!! related TS6500 intersectionPropertyCheck.ts:1:12: The expected type comes from property 'a' which is declared here on type '{ a: { x: string; }; } & { c: number; }' declare let wrong: { a: { y: string } }; diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt index 9115cdefe23a3..2b2e4b701852f 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt @@ -1,6 +1,5 @@ logicalOrExpressionIsContextuallyTyped.ts(6,33): error TS2322: Type '{ a: string; b: number; } | { a: string; b: boolean; }' is not assignable to type '{ a: string; }'. - Type '{ a: string; b: number; }' is not assignable to type '{ a: string; }'. - Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. + Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. ==== logicalOrExpressionIsContextuallyTyped.ts (1 errors) ==== @@ -12,5 +11,4 @@ logicalOrExpressionIsContextuallyTyped.ts(6,33): error TS2322: Type '{ a: string var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; ~ !!! error TS2322: Type '{ a: string; b: number; } | { a: string; b: boolean; }' is not assignable to type '{ a: string; }'. -!!! error TS2322: Type '{ a: string; b: number; }' is not assignable to type '{ a: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. \ No newline at end of file +!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index fb9c6a4fe0916..e03c20d64bff7 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -17,16 +17,12 @@ mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must h mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'. mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. Property 'y' is missing in type '{ x: number; }' but required in type 'Readonly<{ x: number; y: number; }>'. -mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. - Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. -mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. - Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. +mappedTypeErrors.ts(77,59): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. +mappedTypeErrors.ts(83,58): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. mappedTypeErrors.ts(105,17): error TS2322: Type 'undefined' is not assignable to type 'string'. -mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +mappedTypeErrors.ts(106,17): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. mappedTypeErrors.ts(123,14): error TS2322: Type 'undefined' is not assignable to type 'string'. -mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +mappedTypeErrors.ts(124,14): error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number'. mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number'. mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number'. @@ -154,8 +150,7 @@ mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type let x2 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1 }); let x3 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ~ -!!! error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. -!!! error TS2345: Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. } function f21() { @@ -163,8 +158,7 @@ mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type let x2 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1 }); let x3 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ~ -!!! error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. -!!! error TS2345: Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. } // Verify use of Pick for setState functions (#12793) @@ -192,8 +186,7 @@ mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type !!! related TS6500 mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' setState(foo, { c: true }); // Error ~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. class C { state: T; @@ -216,8 +209,7 @@ mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type !!! related TS6500 mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' c.setState({ c: true }); // Error ~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2353: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. type T2 = { a?: number, [key: string]: any }; diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt index 16c95169fe435..4ace83cb599d7 100644 --- a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt @@ -1,5 +1,4 @@ -multiLineContextDiagnosticWithPretty.ts:2:5 - error TS2322: Type '{ a: { b: string; }; }' is not assignable to type '{ c: string; }'. - Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. +multiLineContextDiagnosticWithPretty.ts:2:5 - error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. 2 a: {    ~ @@ -9,8 +8,7 @@ const x: {c: string} = { a: { ~ -!!! error TS2322: Type '{ a: { b: string; }; }' is not assignable to type '{ c: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. b: '', } }; diff --git a/tests/baselines/reference/namespaceImportTypeQuery.errors.txt b/tests/baselines/reference/namespaceImportTypeQuery.errors.txt index 6091fcf19e473..da8516796f429 100644 --- a/tests/baselines/reference/namespaceImportTypeQuery.errors.txt +++ b/tests/baselines/reference/namespaceImportTypeQuery.errors.txt @@ -1,5 +1,4 @@ -/b.ts(8,3): error TS2322: Type '{ A: any; B: any; }' is not assignable to type 'typeof import("/a")'. - Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. +/b.ts(8,3): error TS2353: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. ==== /a.ts (0 errors) ==== @@ -17,8 +16,7 @@ // `typeof types` does not include `A` A: undefined as any, ~ -!!! error TS2322: Type '{ A: any; B: any; }' is not assignable to type 'typeof import("/a")'. -!!! error TS2322: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. +!!! error TS2353: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. B: undefined as any, } \ No newline at end of file diff --git a/tests/baselines/reference/namespaceImportTypeQuery4.errors.txt b/tests/baselines/reference/namespaceImportTypeQuery4.errors.txt index bed29537a36ab..028386baccf51 100644 --- a/tests/baselines/reference/namespaceImportTypeQuery4.errors.txt +++ b/tests/baselines/reference/namespaceImportTypeQuery4.errors.txt @@ -1,6 +1,5 @@ /a.ts(1,24): error TS2307: Cannot find module './z' or its corresponding type declarations. -/b.ts(3,3): error TS2322: Type '{ A: any; B: any; }' is not assignable to type 'typeof import("/a")'. - Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. +/b.ts(3,3): error TS2353: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. ==== /a.ts (1 errors) ==== @@ -16,8 +15,7 @@ let t: typeof types = { A: undefined as any, // error ~ -!!! error TS2322: Type '{ A: any; B: any; }' is not assignable to type 'typeof import("/a")'. -!!! error TS2322: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. +!!! error TS2353: Object literal may only specify known properties, and 'A' does not exist in type 'typeof import("/a")'. B: undefined as any, } \ No newline at end of file diff --git a/tests/baselines/reference/nestedFreshLiteral.errors.txt b/tests/baselines/reference/nestedFreshLiteral.errors.txt index d777a85c1fcc1..983d5bd7e5a8b 100644 --- a/tests/baselines/reference/nestedFreshLiteral.errors.txt +++ b/tests/baselines/reference/nestedFreshLiteral.errors.txt @@ -1,5 +1,4 @@ -nestedFreshLiteral.ts(12,21): error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'. - Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? +nestedFreshLiteral.ts(12,21): error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? ==== nestedFreshLiteral.ts (1 errors) ==== @@ -16,6 +15,5 @@ nestedFreshLiteral.ts(12,21): error TS2322: Type '{ colour: string; }' is not as let stylen: NestedCSSProps = { nested: { prop: { colour: 'red' } } ~~~~~~ -!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'. -!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? +!!! error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? } \ No newline at end of file diff --git a/tests/baselines/reference/nestedRecursiveArraysOrObjectsError01.errors.txt b/tests/baselines/reference/nestedRecursiveArraysOrObjectsError01.errors.txt index d50eaa45e2da6..036d1f4d6443f 100644 --- a/tests/baselines/reference/nestedRecursiveArraysOrObjectsError01.errors.txt +++ b/tests/baselines/reference/nestedRecursiveArraysOrObjectsError01.errors.txt @@ -1,5 +1,4 @@ -nestedRecursiveArraysOrObjectsError01.ts(10,9): error TS2322: Type '{ foo: string; jj: number; }' is not assignable to type 'Style'. - Object literal may only specify known properties, and 'jj' does not exist in type 'Style'. +nestedRecursiveArraysOrObjectsError01.ts(10,9): error TS2353: Object literal may only specify known properties, and 'jj' does not exist in type 'Style'. ==== nestedRecursiveArraysOrObjectsError01.ts (1 errors) ==== @@ -14,8 +13,7 @@ nestedRecursiveArraysOrObjectsError01.ts(10,9): error TS2322: Type '{ foo: strin foo: 'asdf', jj: 1 // intentional error ~~ -!!! error TS2322: Type '{ foo: string; jj: number; }' is not assignable to type 'Style'. -!!! error TS2322: Object literal may only specify known properties, and 'jj' does not exist in type 'Style'. +!!! error TS2353: Object literal may only specify known properties, and 'jj' does not exist in type 'Style'. }]] ]; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt index 73573a67c1bff..c4c4f758de70d 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt @@ -9,8 +9,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(3,52): error TS1128: Declaration or statement expected. /other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. /other.ts(4,7): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -/other.ts(4,22): error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. - Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. /other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. /other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? /other.ts(6,49): error TS1005: 'assert' expected. @@ -128,8 +127,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. -!!! error TS2322: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. ~~~~~~~~~~~~~~~ !!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt index 73573a67c1bff..c4c4f758de70d 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt @@ -9,8 +9,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(3,52): error TS1128: Declaration or statement expected. /other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. /other.ts(4,7): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -/other.ts(4,22): error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. - Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. /other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. /other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? /other.ts(6,49): error TS1005: 'assert' expected. @@ -128,8 +127,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. -!!! error TS2322: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. ~~~~~~~~~~~~~~~ !!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. diff --git a/tests/baselines/reference/nonObjectUnionNestedExcessPropertyCheck.errors.txt b/tests/baselines/reference/nonObjectUnionNestedExcessPropertyCheck.errors.txt index f2695cbb45d10..f4228c011cdec 100644 --- a/tests/baselines/reference/nonObjectUnionNestedExcessPropertyCheck.errors.txt +++ b/tests/baselines/reference/nonObjectUnionNestedExcessPropertyCheck.errors.txt @@ -1,9 +1,6 @@ -nonObjectUnionNestedExcessPropertyCheck.ts(13,35): error TS2322: Type '{ INVALID_PROP_NAME: string; iconProp: string; }' is not assignable to type 'number | IProps'. - Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. -nonObjectUnionNestedExcessPropertyCheck.ts(16,49): error TS2322: Type '{ asdfasdf: string; }' is not assignable to type '{ testBool?: boolean; }'. - Object literal may only specify known properties, and 'asdfasdf' does not exist in type '{ testBool?: boolean; }'. -nonObjectUnionNestedExcessPropertyCheck.ts(19,56): error TS2322: Type '{ INVALID_PROP_NAME: string; iconProp: string; }' is not assignable to type 'IProps'. - Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. +nonObjectUnionNestedExcessPropertyCheck.ts(13,35): error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. +nonObjectUnionNestedExcessPropertyCheck.ts(16,49): error TS2353: Object literal may only specify known properties, and 'asdfasdf' does not exist in type '{ testBool?: boolean; }'. +nonObjectUnionNestedExcessPropertyCheck.ts(19,56): error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. ==== nonObjectUnionNestedExcessPropertyCheck.ts (3 errors) ==== @@ -21,18 +18,15 @@ nonObjectUnionNestedExcessPropertyCheck.ts(19,56): error TS2322: Type '{ INVALID // These are the types of errors we want: const propB1: IProps | number = { INVALID_PROP_NAME: 'share', iconProp: 'test' }; ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ INVALID_PROP_NAME: string; iconProp: string; }' is not assignable to type 'number | IProps'. -!!! error TS2322: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. +!!! error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. // Nested typing works here and we also get an expected error: const propB2: IProps | number = { nestedProp: { asdfasdf: 'test' }, iconProp: 'test' }; ~~~~~~~~ -!!! error TS2322: Type '{ asdfasdf: string; }' is not assignable to type '{ testBool?: boolean; }'. -!!! error TS2322: Object literal may only specify known properties, and 'asdfasdf' does not exist in type '{ testBool?: boolean; }'. +!!! error TS2353: Object literal may only specify known properties, and 'asdfasdf' does not exist in type '{ testBool?: boolean; }'. // Want an error generated here but there isn't one. const propA1: INestedProps | number = { nestedProps: { INVALID_PROP_NAME: 'share', iconProp: 'test' } }; ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ INVALID_PROP_NAME: string; iconProp: string; }' is not assignable to type 'IProps'. -!!! error TS2322: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. +!!! error TS2353: Object literal may only specify known properties, and 'INVALID_PROP_NAME' does not exist in type 'IProps'. \ No newline at end of file diff --git a/tests/baselines/reference/nonPrimitiveUnionIntersection.errors.txt b/tests/baselines/reference/nonPrimitiveUnionIntersection.errors.txt index efca80601a7a9..d808f063094bf 100644 --- a/tests/baselines/reference/nonPrimitiveUnionIntersection.errors.txt +++ b/tests/baselines/reference/nonPrimitiveUnionIntersection.errors.txt @@ -1,8 +1,7 @@ nonPrimitiveUnionIntersection.ts(1,5): error TS2322: Type 'string' is not assignable to type 'never'. nonPrimitiveUnionIntersection.ts(3,5): error TS2322: Type 'number' is not assignable to type 'object'. nonPrimitiveUnionIntersection.ts(4,1): error TS2322: Type 'string' is not assignable to type 'never'. -nonPrimitiveUnionIntersection.ts(8,38): error TS2322: Type '{ bar: string; }' is not assignable to type 'object & { err: string; }'. - Object literal may only specify known properties, and 'bar' does not exist in type 'object & { err: string; }'. +nonPrimitiveUnionIntersection.ts(8,38): error TS2353: Object literal may only specify known properties, and 'bar' does not exist in type 'object & { err: string; }'. ==== nonPrimitiveUnionIntersection.ts (4 errors) ==== @@ -21,6 +20,5 @@ nonPrimitiveUnionIntersection.ts(8,38): error TS2322: Type '{ bar: string; }' is const foo: object & {} = {bar: 'bar'}; // ok const bar: object & {err: string} = {bar: 'bar'}; // error ~~~ -!!! error TS2322: Type '{ bar: string; }' is not assignable to type 'object & { err: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'bar' does not exist in type 'object & { err: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'bar' does not exist in type 'object & { err: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitIndexerContextualType.errors.txt b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt index aac86f2bc7c48..55a626bbc66b8 100644 --- a/tests/baselines/reference/objectLitIndexerContextualType.errors.txt +++ b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt @@ -2,8 +2,7 @@ objectLitIndexerContextualType.ts(12,13): error TS2362: The left-hand side of an objectLitIndexerContextualType.ts(12,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. objectLitIndexerContextualType.ts(15,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. objectLitIndexerContextualType.ts(15,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -objectLitIndexerContextualType.ts(18,5): error TS2322: Type '{ s: (t: any) => number; }' is not assignable to type 'J'. - Object literal may only specify known properties, and 's' does not exist in type 'J'. +objectLitIndexerContextualType.ts(18,5): error TS2353: Object literal may only specify known properties, and 's' does not exist in type 'J'. objectLitIndexerContextualType.ts(21,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. objectLitIndexerContextualType.ts(21,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -36,8 +35,7 @@ objectLitIndexerContextualType.ts(21,17): error TS2363: The right-hand side of a y = { s: t => t * t, // Should error ~ -!!! error TS2322: Type '{ s: (t: any) => number; }' is not assignable to type 'J'. -!!! error TS2322: Object literal may only specify known properties, and 's' does not exist in type 'J'. +!!! error TS2353: Object literal may only specify known properties, and 's' does not exist in type 'J'. }; y = { 0: t => t * t, // Should error diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt index 8ee2ee75d292c..115871ea02dfa 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -1,10 +1,8 @@ -objectLitStructuralTypeMismatch.ts(2,27): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. - Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. +objectLitStructuralTypeMismatch.ts(2,27): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. ==== objectLitStructuralTypeMismatch.ts (1 errors) ==== // Shouldn't compile var x: { a: number; } = { b: 5 }; ~ -!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. \ No newline at end of file +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt index 6e3e710aff4fb..f70d099248298 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt @@ -1,35 +1,23 @@ -objectLiteralExcessProperties.ts(9,18): error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'. - Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? -objectLiteralExcessProperties.ts(11,27): error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. - Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? -objectLiteralExcessProperties.ts(13,53): error TS2322: Type '{ forwards: string; }' is not assignable to type 'Book'. - Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. -objectLiteralExcessProperties.ts(15,42): error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. - Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? -objectLiteralExcessProperties.ts(17,26): error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. - Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? -objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. - Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. +objectLiteralExcessProperties.ts(9,18): error TS2561: Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? +objectLiteralExcessProperties.ts(11,27): error TS2561: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? +objectLiteralExcessProperties.ts(13,53): error TS2353: Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. +objectLiteralExcessProperties.ts(15,42): error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? +objectLiteralExcessProperties.ts(17,26): error TS2561: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? +objectLiteralExcessProperties.ts(19,57): error TS2353: Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. objectLiteralExcessProperties.ts(21,5): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. Type '{ foreword: string; price: number; }' is not assignable to type 'number'. -objectLiteralExcessProperties.ts(23,29): error TS2322: Type '{ couleur: string; }' is not assignable to type 'Cover | Cover[]'. - Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. -objectLiteralExcessProperties.ts(25,27): error TS2322: Type '{ forewarned: string; }' is not assignable to type 'Book | Book[]'. - Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. -objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. - Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? +objectLiteralExcessProperties.ts(23,29): error TS2353: Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. +objectLiteralExcessProperties.ts(25,27): error TS2353: Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. +objectLiteralExcessProperties.ts(33,27): error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? objectLiteralExcessProperties.ts(37,25): error TS2304: Cannot find name 'IFoo'. objectLiteralExcessProperties.ts(39,11): error TS2322: Type '{ name: string; }' is not assignable to type 'T'. '{ name: string; }' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'IFoo'. objectLiteralExcessProperties.ts(41,11): error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T & { prop: boolean; }'. Type '{ name: string; prop: boolean; }' is not assignable to type 'T'. '{ name: string; prop: boolean; }' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'IFoo'. -objectLiteralExcessProperties.ts(43,43): error TS2322: Type '{ name: string; prop: true; }' is not assignable to type 'T | { prop: boolean; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. -objectLiteralExcessProperties.ts(45,76): error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type '(T & { prop: boolean; }) | { name: string; }'. - Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. -objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is not assignable to type 'object & { x: string; }'. - Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. +objectLiteralExcessProperties.ts(43,43): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. +objectLiteralExcessProperties.ts(45,76): error TS2353: Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. +objectLiteralExcessProperties.ts(49,44): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. ==== objectLiteralExcessProperties.ts (16 errors) ==== @@ -43,33 +31,27 @@ objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is var b1: Book = { forword: "oops" }; ~~~~~~~ -!!! error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'. -!!! error TS2322: Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? +!!! error TS2561: Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? var b2: Book | string = { foreward: "nope" }; ~~~~~~~~ -!!! error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. -!!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? +!!! error TS2561: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? var b3: Book | (Book[]) = [{ foreword: "hello" }, { forwards: "back" }]; ~~~~~~~~ -!!! error TS2322: Type '{ forwards: string; }' is not assignable to type 'Book'. -!!! error TS2322: Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. +!!! error TS2353: Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. var b4: Book & Cover = { foreword: "hi", colour: "blue" }; ~~~~~~ -!!! error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. -!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? +!!! error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? var b5: Book & Cover = { foreward: "hi", color: "blue" }; ~~~~~~~~ -!!! error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. -!!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? +!!! error TS2561: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 }; ~~~~~ -!!! error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. -!!! error TS2322: Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. +!!! error TS2353: Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. var b7: Book & number = { foreword: "hi", price: 10.99 }; ~~ @@ -78,13 +60,11 @@ objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is var b8: Cover | Cover[] = { couleur : "non" }; ~~~~~~~ -!!! error TS2322: Type '{ couleur: string; }' is not assignable to type 'Cover | Cover[]'. -!!! error TS2322: Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. +!!! error TS2353: Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. var b9: Book | Book[] = { forewarned: "still no" }; ~~~~~~~~~~ -!!! error TS2322: Type '{ forewarned: string; }' is not assignable to type 'Book | Book[]'. -!!! error TS2322: Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. +!!! error TS2353: Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. interface Indexed { [n: number]: Cover; @@ -94,8 +74,7 @@ objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still errors ~~~~~~ -!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. -!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? +!!! error TS2561: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? !!! related TS6501 objectLiteralExcessProperties.ts:28:5: The expected type comes from this index signature. // Repros inspired by #28752 @@ -117,19 +96,16 @@ objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is // Excess property checks only on non-generic parts of unions const obj3: T | { prop: boolean } = { name: "test", prop: true }; ~~~~ -!!! error TS2322: Type '{ name: string; prop: true; }' is not assignable to type 'T | { prop: boolean; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. // Excess property checks only on non-generic parts of unions const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; ~~~~ -!!! error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type '(T & { prop: boolean; }) | { name: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. // No excess property checks when union includes 'object' type const obj5: object | { x: string } = { z: 'abc' } // The 'object' type has no effect on intersections const obj6: object & { x: string } = { z: 'abc' } ~ -!!! error TS2322: Type '{ z: string; }' is not assignable to type 'object & { x: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFreshnessWithSpread.errors.txt b/tests/baselines/reference/objectLiteralFreshnessWithSpread.errors.txt index bf87cef5dfc83..1aa20e5b9e331 100644 --- a/tests/baselines/reference/objectLiteralFreshnessWithSpread.errors.txt +++ b/tests/baselines/reference/objectLiteralFreshnessWithSpread.errors.txt @@ -1,11 +1,9 @@ -objectLiteralFreshnessWithSpread.ts(2,35): error TS2322: Type '{ z: number; b: number; extra: number; a: number; }' is not assignable to type '{ a: any; b: any; }'. - Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'. +objectLiteralFreshnessWithSpread.ts(2,35): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'. ==== objectLiteralFreshnessWithSpread.ts (1 errors) ==== let x = { b: 1, extra: 2 } let xx: { a, b } = { a: 1, ...x, z: 3 } // error for 'z', no error for 'extra' ~ -!!! error TS2322: Type '{ z: number; b: number; extra: number; a: number; }' is not assignable to type '{ a: any; b: any; }'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt index ab923b4b16623..44966abfa8251 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt @@ -1,7 +1,5 @@ -objectLiteralFunctionArgContextualTyping.ts(8,6): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. - Object literal may only specify known properties, and 'hello' does not exist in type 'I'. -objectLiteralFunctionArgContextualTyping.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I'. - Object literal may only specify known properties, and 'what' does not exist in type 'I'. +objectLiteralFunctionArgContextualTyping.ts(8,6): error TS2353: Object literal may only specify known properties, and 'hello' does not exist in type 'I'. +objectLiteralFunctionArgContextualTyping.ts(10,17): error TS2353: Object literal may only specify known properties, and 'what' does not exist in type 'I'. objectLiteralFunctionArgContextualTyping.ts(11,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. Property 'value' is missing in type '{ toString: (s: string) => string; }' but required in type 'I'. objectLiteralFunctionArgContextualTyping.ts(12,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. @@ -19,13 +17,11 @@ objectLiteralFunctionArgContextualTyping.ts(13,36): error TS2339: Property 'uhhh f2({ hello: 1 }) // error ~~~~~ -!!! error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. -!!! error TS2345: Object literal may only specify known properties, and 'hello' does not exist in type 'I'. +!!! error TS2353: Object literal may only specify known properties, and 'hello' does not exist in type 'I'. f2({ value: '' }) // missing toString satisfied by Object's member f2({ value: '', what: 1 }) // missing toString satisfied by Object's member ~~~~ -!!! error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I'. -!!! error TS2345: Object literal may only specify known properties, and 'what' does not exist in type 'I'. +!!! error TS2353: Object literal may only specify known properties, and 'what' does not exist in type 'I'. f2({ toString: (s) => s }) // error, missing property value from ArgsString ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index 62aadea55ae09..0491a4b8ac371 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -1,9 +1,7 @@ -objectLiteralFunctionArgContextualTyping2.ts(8,6): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. - Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. +objectLiteralFunctionArgContextualTyping2.ts(8,6): error TS2353: Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. Property 'doStuff' is missing in type '{ value: string; }' but required in type 'I2'. -objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. - Object literal may only specify known properties, and 'what' does not exist in type 'I2'. +objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2353: Object literal may only specify known properties, and 'what' does not exist in type 'I2'. objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. Target signature provides too few arguments. Expected 1 or more, but got 0. objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. @@ -22,8 +20,7 @@ objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any f2({ hello: 1 }) ~~~~~ -!!! error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. -!!! error TS2345: Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. +!!! error TS2353: Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. f2({ value: '' }) ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. @@ -31,8 +28,7 @@ objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any !!! related TS2728 objectLiteralFunctionArgContextualTyping2.ts:3:5: 'doStuff' is declared here. f2({ value: '', what: 1 }) ~~~~ -!!! error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. -!!! error TS2345: Object literal may only specify known properties, and 'what' does not exist in type 'I2'. +!!! error TS2353: Object literal may only specify known properties, and 'what' does not exist in type 'I2'. f2({ toString: (s) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt index faee25d8b1e75..03ff2feed1ff8 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt @@ -1,5 +1,4 @@ -objectLiteralShorthandPropertiesAssignmentError.ts(4,43): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. +objectLiteralShorthandPropertiesAssignmentError.ts(4,43): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. objectLiteralShorthandPropertiesAssignmentError.ts(6,81): error TS2322: Type 'string' is not assignable to type 'number'. objectLiteralShorthandPropertiesAssignmentError.ts(6,87): error TS2322: Type 'number' is not assignable to type 'string'. objectLiteralShorthandPropertiesAssignmentError.ts(8,13): error TS2322: Type 'number' is not assignable to type 'boolean'. @@ -11,8 +10,7 @@ objectLiteralShorthandPropertiesAssignmentError.ts(8,13): error TS2322: Type 'nu var person: { b: string; id: number } = { name, id }; // error ~~~~ -!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. var person1: { name, id }; // ok function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error ~~~~ diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt index 52d14f7b58c7f..79bec80bd7c5d 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt @@ -1,5 +1,4 @@ -objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,43): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. - Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. +objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,43): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,81): error TS2322: Type 'string' is not assignable to type 'number'. objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,87): error TS2322: Type 'number' is not assignable to type 'string'. objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. @@ -13,8 +12,7 @@ objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): er var person: { b: string; id: number } = { name, id }; // error ~~~~ -!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error ~~~~ !!! error TS2322: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index 529235dbfe34a..0cfe46d258b87 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,19 +1,15 @@ orderMattersForSignatureGroupIdentity.ts(19,1): error TS2769: No overload matches this call. Overload 1 of 2, '(x: { s: string; }): string', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. - Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. Overload 2 of 2, '(x: { n: number; }): number', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. orderMattersForSignatureGroupIdentity.ts(19,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. orderMattersForSignatureGroupIdentity.ts(24,1): error TS2769: No overload matches this call. Overload 1 of 2, '(x: { s: string; }): string', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. - Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. Overload 2 of 2, '(x: { n: number; }): number', gave the following error. - Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. + Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. @@ -40,11 +36,9 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower ~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2769: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. !!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2769: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +!!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. ~~~~~~~~~~~ !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. @@ -58,10 +52,8 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower ~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2769: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. !!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2769: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +!!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. ~~~~~~~~~~~ !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt index e8508d55a4240..344a5571d72ae 100644 --- a/tests/baselines/reference/propertyAccess.errors.txt +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -1,5 +1,4 @@ -propertyAccess.ts(11,55): error TS2322: Type '{ 3: string; three: string; }' is not assignable to type '{ [n: number]: string; }'. - Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. +propertyAccess.ts(11,55): error TS2353: Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. propertyAccess.ts(45,14): error TS2339: Property 'qqq' does not exist on type '{ 10: string; x: string; y: number; z: { n: string; m: number; o: () => boolean; }; 'literal property': number; }'. propertyAccess.ts(80,19): error TS2538: Type '{ name: string; }' cannot be used as an index type. propertyAccess.ts(117,18): error TS2538: Type '{ name: string; }' cannot be used as an index type. @@ -20,8 +19,7 @@ propertyAccess.ts(149,5): error TS2403: Subsequent variable declarations must ha var numIndex: { [n: number]: string } = { 3: 'three', 'three': 'three' }; ~~~~~~~ -!!! error TS2322: Type '{ 3: string; three: string; }' is not assignable to type '{ [n: number]: string; }'. -!!! error TS2322: Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. +!!! error TS2353: Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. var strIndex: { [n: string]: Compass } = { 'N': Compass.North, 'E': Compass.East }; var bothIndex: { diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt index 0508bd4cecf67..10d7854b900a5 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt @@ -1,6 +1,5 @@ spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'? -spellingSuggestionLeadingUnderscores01.ts(14,5): error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'. - Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? +spellingSuggestionLeadingUnderscores01.ts(14,5): error TS2561: Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? ==== spellingSuggestionLeadingUnderscores01.ts (2 errors) ==== @@ -22,8 +21,7 @@ spellingSuggestionLeadingUnderscores01.ts(14,5): error TS2322: Type '{ ___foo: n b = { ___foo: 100, ~~~~~~ -!!! error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'. -!!! error TS2322: Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? +!!! error TS2561: Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? } \ No newline at end of file diff --git a/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt b/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt index 6b132f2e9ec2a..0107ab0f6e253 100644 --- a/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt +++ b/tests/baselines/reference/strictSubtypeAndNarrowing.errors.txt @@ -1,9 +1,6 @@ -strictSubtypeAndNarrowing.ts(123,27): error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. -strictSubtypeAndNarrowing.ts(124,27): error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. -strictSubtypeAndNarrowing.ts(129,26): error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +strictSubtypeAndNarrowing.ts(123,27): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +strictSubtypeAndNarrowing.ts(124,27): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +strictSubtypeAndNarrowing.ts(129,26): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. ==== strictSubtypeAndNarrowing.ts (3 errors) ==== @@ -131,20 +128,17 @@ strictSubtypeAndNarrowing.ts(129,26): error TS2322: Type '{ x: number; y: number function fx10(obj1: { x?: number }, obj2: { x?: number, y?: number }) { obj1 = obj2 = { x: 1, y: 2 }; ~ -!!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. obj2 = obj1 = { x: 1, y: 2 }; ~ -!!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. } function fx11(): { x?: number } { let obj: { x?: number, y?: number }; return obj = { x: 1, y: 2 }; ~ -!!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type '{ x?: number | undefined; }'. -!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x?: number | undefined; }'. } // Repros from #52827 diff --git a/tests/baselines/reference/switchStatements.errors.txt b/tests/baselines/reference/switchStatements.errors.txt index c27cc0792ee73..5ffcf502b7baf 100644 --- a/tests/baselines/reference/switchStatements.errors.txt +++ b/tests/baselines/reference/switchStatements.errors.txt @@ -1,5 +1,4 @@ -switchStatements.ts(35,20): error TS2678: Type '{ id: number; name: string; }' is not comparable to type 'C'. - Object literal may only specify known properties, and 'name' does not exist in type 'C'. +switchStatements.ts(35,20): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'C'. ==== switchStatements.ts (1 errors) ==== @@ -39,8 +38,7 @@ switchStatements.ts(35,20): error TS2678: Type '{ id: number; name: string; }' i case new D(): case { id: 12, name: '' }: ~~~~ -!!! error TS2678: Type '{ id: number; name: string; }' is not comparable to type 'C'. -!!! error TS2678: Object literal may only specify known properties, and 'name' does not exist in type 'C'. +!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'C'. case new C(): } diff --git a/tests/baselines/reference/symbolProperty21.errors.txt b/tests/baselines/reference/symbolProperty21.errors.txt index fe2ddd658f07b..a051262405c9f 100644 --- a/tests/baselines/reference/symbolProperty21.errors.txt +++ b/tests/baselines/reference/symbolProperty21.errors.txt @@ -1,5 +1,4 @@ -symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. - Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. +symbolProperty21.ts(10,5): error TS2353: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. ==== symbolProperty21.ts (1 errors) ==== @@ -14,7 +13,6 @@ symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpr [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. -!!! error TS2345: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. +!!! error TS2353: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. [Symbol.unscopables]: true }); \ No newline at end of file diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 5768e9206862f..1356e69cfeb19 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -4,12 +4,9 @@ thisTypeInFunctionsNegative.ts(49,1): error TS2684: The 'this' context of type ' thisTypeInFunctionsNegative.ts(51,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'. thisTypeInFunctionsNegative.ts(56,21): error TS2339: Property 'notFound' does not exist on type '{ y: number; }'. thisTypeInFunctionsNegative.ts(59,21): error TS2339: Property 'notSpecified' does not exist on type 'void'. -thisTypeInFunctionsNegative.ts(61,79): error TS2322: Type '{ y: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. - Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. -thisTypeInFunctionsNegative.ts(62,97): error TS2322: Type '{ y: string; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. - Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. -thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. - Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. +thisTypeInFunctionsNegative.ts(61,79): error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. +thisTypeInFunctionsNegative.ts(62,97): error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. +thisTypeInFunctionsNegative.ts(63,110): error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. thisTypeInFunctionsNegative.ts(65,4): error TS2554: Expected 1 arguments, but got 0. thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. thisTypeInFunctionsNegative.ts(67,10): error TS2554: Expected 1 arguments, but got 2. @@ -168,16 +165,13 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h } let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. let wrongPropertyType: {y: string, f: (this: { y: number }, x: number) => number} = { y: 'foo', explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: string; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. let wrongPropertyName: {wrongName: number, f: (this: { y: number }, x: number) => number} = { wrongName: 12, explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. ok.f(); // not enough arguments ~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index 4e2c663ace7cc..becf1c637f0f0 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -172,7 +171,7 @@ require("./d"); //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -287,20 +286,9 @@ require("./d"); "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -331,7 +319,7 @@ require("./d"); ] }, "version": "FakeTSVersion", - "size": 1981 + "size": 1819 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js index f062cfbe66564..76ac5320e237b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export-with-incremental.js index 86452a705ff5d..4b3663b983d82 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export-with-incremental.js @@ -353,8 +353,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -400,7 +399,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -543,20 +542,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -564,7 +552,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2315 + "size": 2161 } @@ -584,8 +572,7 @@ Output:: >> Screen clear [12:01:27 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -619,7 +606,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -762,20 +749,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -783,7 +759,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2313 + "size": 2159 } @@ -803,8 +779,7 @@ Output:: >> Screen clear [12:01:44 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -838,7 +813,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -981,20 +956,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1002,6 +966,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2315 + "size": 2161 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export.js index ecb691fb0d7d8..d2141d0042e8b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/no-circular-import/export.js @@ -229,8 +229,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -292,8 +291,7 @@ Output:: >> Screen clear [12:01:17 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -343,8 +341,7 @@ Output:: >> Screen clear [12:01:28 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports-with-incremental.js index 0a33e4712a6f9..4ea0b9d378cce 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports-with-incremental.js @@ -391,8 +391,7 @@ Output:: >> Screen clear [12:01:02 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -442,7 +441,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -603,20 +602,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -625,7 +613,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2678 + "size": 2524 } @@ -645,8 +633,7 @@ Output:: >> Screen clear [12:01:34 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -681,7 +668,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -842,20 +829,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -864,7 +840,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2676 + "size": 2522 } @@ -884,8 +860,7 @@ Output:: >> Screen clear [12:01:51 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -920,7 +895,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"assumeChangesOnlyAffectDirectDependencies":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1081,20 +1056,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1103,6 +1067,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2678 + "size": 2524 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports.js index 1b2fc0c65cbfc..c90910e598f07 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/transitive-exports/yes-circular-import/exports.js @@ -252,8 +252,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -319,8 +318,7 @@ Output:: >> Screen clear [12:01:24 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -371,8 +369,7 @@ Output:: >> Screen clear [12:01:35 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index 47bb3c9dd331f..0acbae35d6b14 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -202,7 +201,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -335,20 +334,9 @@ import "./d"; "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -379,7 +367,7 @@ import "./d"; ] }, "version": "FakeTSVersion", - "size": 2516 + "size": 2354 } @@ -404,8 +392,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -460,7 +447,7 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -593,20 +580,9 @@ export interface Coords { "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -637,7 +613,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2513 + "size": 2351 } @@ -662,8 +638,7 @@ Output:: >> Screen clear [12:01:21 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -718,7 +693,7 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -851,20 +826,9 @@ export interface Coords { "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -895,7 +859,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2516 + "size": 2354 } @@ -920,8 +884,7 @@ Output:: >> Screen clear [12:01:44 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -976,7 +939,7 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1109,20 +1072,9 @@ export interface Coords { "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -1153,6 +1105,6 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2513 + "size": 2351 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 49d7a8f96611f..39281cd2f36a5 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -223,8 +222,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -300,8 +298,7 @@ Output:: >> Screen clear [12:01:11 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -377,8 +374,7 @@ Output:: >> Screen clear [12:01:28 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index c7757179fd00e..304a8659277a3 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -172,7 +171,7 @@ require("./d"); //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -284,20 +283,9 @@ require("./d"); "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -328,7 +316,7 @@ require("./d"); ] }, "version": "FakeTSVersion", - "size": 1920 + "size": 1758 } @@ -543,8 +531,7 @@ Output:: >> Screen clear [12:01:14 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -591,7 +578,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;",{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;",{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -715,20 +702,9 @@ exitCode:: ExitStatus.undefined "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -759,7 +735,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2262 + "size": 2100 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js index 3791b1cba47e9..71af769d67374 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -251,8 +250,7 @@ Output:: >> Screen clear [12:01:04 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export-with-incremental.js index 06c82cfa9676b..1af187277d8db 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export-with-incremental.js @@ -350,8 +350,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -397,7 +396,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -537,20 +536,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -558,7 +546,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2254 + "size": 2100 } @@ -760,8 +748,7 @@ Output:: >> Screen clear [12:01:44 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -803,7 +790,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},"-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},"-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -930,20 +917,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -951,6 +927,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1897 + "size": 1743 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export.js index a11ecb0a62798..14ef9a9d4d7c8 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/no-circular-import/export.js @@ -229,8 +229,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -345,8 +344,7 @@ Output:: >> Screen clear [12:01:28 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports-with-incremental.js index 39908a0fa4990..e3680edd94ff1 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports-with-incremental.js @@ -388,8 +388,7 @@ Output:: >> Screen clear [12:01:02 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -439,7 +438,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -597,20 +596,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -619,7 +607,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2617 + "size": 2463 } @@ -839,8 +827,7 @@ Output:: >> Screen clear [12:01:51 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -885,7 +872,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},"-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},"-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1026,20 +1013,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1048,6 +1024,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2082 + "size": 1928 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports.js index a3afffd502808..3be9b6d450994 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/transitive-exports/yes-circular-import/exports.js @@ -252,8 +252,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -375,8 +374,7 @@ Output:: >> Screen clear [12:01:35 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index dcb9be67d3ef4..b7e05e73dac1f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -202,7 +201,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -334,20 +333,9 @@ import "./d"; "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -378,7 +366,7 @@ import "./d"; ] }, "version": "FakeTSVersion", - "size": 2467 + "size": 2305 } @@ -605,8 +593,7 @@ Output:: >> Screen clear [12:01:27 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -667,7 +654,7 @@ export interface Coords { //// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -799,20 +786,9 @@ export interface Coords { "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -843,7 +819,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2467 + "size": 2305 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index f3f4c6212fbc0..827cf2f0f1049 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -290,8 +289,7 @@ Output:: >> Screen clear [12:01:17 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export-with-incremental.js index 95b44e78c5b49..7e1806f20d7dd 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export-with-incremental.js @@ -405,8 +405,7 @@ Output:: >> Screen clear [12:01:10 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -459,7 +458,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -602,20 +601,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -623,7 +611,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2285 + "size": 2131 } @@ -852,8 +840,7 @@ Output:: >> Screen clear [12:02:20 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -906,7 +893,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1049,20 +1036,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1070,6 +1046,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2285 + "size": 2131 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js index 37e1cf3705aee..dae78e1c16498 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js @@ -260,8 +260,7 @@ Output:: >> Screen clear [12:01:06 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -394,8 +393,7 @@ Output:: >> Screen clear [12:02:04 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports-with-incremental.js index 5c7c7c6fb774e..19e3541202cf5 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports-with-incremental.js @@ -456,8 +456,7 @@ Output:: >> Screen clear [12:01:16 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -514,7 +513,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -675,20 +674,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -697,7 +685,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2648 + "size": 2494 } @@ -949,8 +937,7 @@ Output:: >> Screen clear [12:02:32 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -1007,7 +994,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1168,20 +1155,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1190,6 +1166,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2648 + "size": 2494 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js index 1c618a25f64c6..05adba9585299 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js @@ -292,8 +292,7 @@ Output:: >> Screen clear [12:01:12 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -434,8 +433,7 @@ Output:: >> Screen clear [12:02:16 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index c5597dabf0e17..fbb43bb2ffb34 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -172,7 +171,7 @@ require("./d"); //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -284,20 +283,9 @@ require("./d"); "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -328,7 +316,7 @@ require("./d"); ] }, "version": "FakeTSVersion", - "size": 1920 + "size": 1758 } @@ -526,8 +514,7 @@ Output:: >> Screen clear [12:01:02 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -575,7 +562,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"root":[[2,6]],"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -691,20 +678,9 @@ exitCode:: ExitStatus.undefined "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -735,7 +711,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2085 + "size": 1923 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js index 5d4bd9ba1da2e..c619a0f667140 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -247,8 +246,7 @@ Output:: >> Screen clear [12:00:52 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export-with-incremental.js index e9ae1e26642e3..cccabce366795 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export-with-incremental.js @@ -350,8 +350,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -392,7 +391,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -515,20 +514,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -536,7 +524,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1820 + "size": 1666 } @@ -733,8 +721,7 @@ Output:: >> Screen clear [12:01:26 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -775,7 +762,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[7],"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -898,20 +885,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -919,6 +895,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1820 + "size": 1666 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export.js index fcc01ad2d02de..6e1a6e2bf4438 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/no-circular-import/export.js @@ -229,8 +229,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -339,8 +338,7 @@ Output:: >> Screen clear [12:01:10 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports-with-incremental.js index cfe2b09d30971..cd42afccc084d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports-with-incremental.js @@ -388,8 +388,7 @@ Output:: >> Screen clear [12:01:02 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -433,7 +432,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -570,20 +569,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -592,7 +580,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2005 + "size": 1851 } @@ -807,8 +795,7 @@ Output:: >> Screen clear [12:01:30 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -852,7 +839,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/lib1/tools/toolsinterface.js] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-10750058173-export * from \"./toolsinterface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"root":[8],"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -989,20 +976,9 @@ exitCode:: ExitStatus.undefined "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1011,6 +987,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2005 + "size": 1851 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports.js index 78ba049e90d1f..055fd1be6a83b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/transitive-exports/yes-circular-import/exports.js @@ -252,8 +252,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -368,8 +367,7 @@ Output:: >> Screen clear [12:01:14 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js index fa96b4d61db67..5a48b397595ec 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes-with-incremental.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -202,7 +201,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -334,20 +333,9 @@ import "./d"; "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -378,7 +366,7 @@ import "./d"; ] }, "version": "FakeTSVersion", - "size": 2467 + "size": 2305 } @@ -607,8 +595,7 @@ Output:: >> Screen clear [12:01:27 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -671,7 +658,7 @@ export interface Coords { //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"root":[[2,6]],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":1,"code":2353,"category":1,"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -803,20 +790,9 @@ export interface Coords { "file": "./c.ts", "start": 139, "length": 1, - "code": 2322, + "code": 2353, "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", "relatedInformation": [ { "file": "./a.ts", @@ -847,7 +823,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2467 + "size": 2305 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 425ea8279d31a..d4044867a405f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -56,8 +56,7 @@ Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ @@ -292,8 +291,7 @@ Output:: >> Screen clear [12:01:17 AM] File change detected. Starting incremental compilation... -c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. - Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. +c.ts:6:13 - error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. 6 x: 1,    ~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export-with-incremental.js index 1c22190a1c05a..af549b3c4f51f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export-with-incremental.js @@ -405,8 +405,7 @@ Output:: >> Screen clear [12:01:10 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -458,7 +457,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -601,20 +600,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -622,7 +610,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2285 + "size": 2131 } @@ -850,8 +838,7 @@ Output:: >> Screen clear [12:02:14 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -903,7 +890,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[7],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1046,20 +1033,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 121, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1067,6 +1043,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2285 + "size": 2131 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js index 0d893d60675fb..94244591a75dd 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js @@ -260,8 +260,7 @@ Output:: >> Screen clear [12:01:06 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -392,8 +391,7 @@ Output:: >> Screen clear [12:01:58 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports-with-incremental.js index b4a046225daf5..c62d73b5b1660 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports-with-incremental.js @@ -456,8 +456,7 @@ Output:: >> Screen clear [12:01:16 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -513,7 +512,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -674,20 +673,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -696,7 +684,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2648 + "size": 2494 } @@ -947,8 +935,7 @@ Output:: >> Screen clear [12:02:26 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -1004,7 +991,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/toolsinterface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-10750058173-export * from \"./toolsinterface\";","signature":"-11154536019-export * from \"./toolsinterface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"root":[8],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":5,"code":2561,"category":1,"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?"}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1165,20 +1152,9 @@ export interface ITest { "file": "./lib2/data.ts", "start": 174, "length": 5, - "code": 2322, + "code": 2561, "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } + "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?" } ] ], @@ -1187,6 +1163,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2648 + "size": 2494 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js index 1f031ad5ae335..6e08546b9c353 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js @@ -292,8 +292,7 @@ Output:: >> Screen clear [12:01:12 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ @@ -432,8 +431,7 @@ Output:: >> Screen clear [12:02:10 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? +lib2/data.ts:5:13 - error TS2561: Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? 5 title: "title"    ~~~~~ diff --git a/tests/baselines/reference/typeArgumentDefaultUsesConstraintOnCircularDefault.errors.txt b/tests/baselines/reference/typeArgumentDefaultUsesConstraintOnCircularDefault.errors.txt index 6f059a0353452..41ae6591b6dd7 100644 --- a/tests/baselines/reference/typeArgumentDefaultUsesConstraintOnCircularDefault.errors.txt +++ b/tests/baselines/reference/typeArgumentDefaultUsesConstraintOnCircularDefault.errors.txt @@ -1,6 +1,5 @@ typeArgumentDefaultUsesConstraintOnCircularDefault.ts(1,30): error TS2744: Type parameter defaults can only reference previously declared type parameters. -typeArgumentDefaultUsesConstraintOnCircularDefault.ts(3,18): error TS2322: Type '{ foo: string; }' is not assignable to type 'Test'. - Object literal may only specify known properties, and 'foo' does not exist in type 'Test'. +typeArgumentDefaultUsesConstraintOnCircularDefault.ts(3,18): error TS2353: Object literal may only specify known properties, and 'foo' does not exist in type 'Test'. ==== typeArgumentDefaultUsesConstraintOnCircularDefault.ts (2 errors) ==== @@ -10,8 +9,7 @@ typeArgumentDefaultUsesConstraintOnCircularDefault.ts(3,18): error TS2322: Type let zz: Test = { foo: "abc" }; // should error on comparison with Test ~~~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Test'. -!!! error TS2322: Object literal may only specify known properties, and 'foo' does not exist in type 'Test'. +!!! error TS2353: Object literal may only specify known properties, and 'foo' does not exist in type 'Test'. let zzy: Test = { value: {} }; diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index bb653483e5975..fac6267357ee7 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,8 +1,7 @@ typeArgumentInference.ts(68,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. typeArgumentInference.ts(69,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. -typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. - Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +typeArgumentInference.ts(84,74): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. ==== typeArgumentInference.ts (4 errors) ==== @@ -99,8 +98,7 @@ typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: !!! related TS6203 typeArgumentInference.ts:82:5: 'a9e' was also declared here. var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index f15a8eff9d480..98b9862c07c8f 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -11,8 +11,7 @@ typeArgumentInferenceConstructSignatures.ts(81,45): error TS2345: Argument of ty typeArgumentInferenceConstructSignatures.ts(106,33): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. typeArgumentInferenceConstructSignatures.ts(107,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window & typeof globalThis; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. -typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. - Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +typeArgumentInferenceConstructSignatures.ts(122,74): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. ==== typeArgumentInferenceConstructSignatures.ts (8 errors) ==== @@ -161,8 +160,7 @@ typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of t !!! related TS6203 typeArgumentInferenceConstructSignatures.ts:120:5: 'a9e' was also declared here. var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 5dbba5a8e1849..a4780472b019a 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -19,8 +19,7 @@ typeArgumentInferenceWithConstraints.ts(67,1): error TS2349: This expression is typeArgumentInferenceWithConstraints.ts(73,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. typeArgumentInferenceWithConstraints.ts(74,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window & typeof globalThis; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. -typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. - Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +typeArgumentInferenceWithConstraints.ts(89,70): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. ==== typeArgumentInferenceWithConstraints.ts (15 errors) ==== @@ -152,8 +151,7 @@ typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type ' !!! related TS6203 typeArgumentInferenceWithConstraints.ts:87:5: 'a9e' was also declared here. var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/tests/baselines/reference/typeFromPropertyAssignment28.errors.txt b/tests/baselines/reference/typeFromPropertyAssignment28.errors.txt index c61a2f4ebcd07..5d83645e1e442 100644 --- a/tests/baselines/reference/typeFromPropertyAssignment28.errors.txt +++ b/tests/baselines/reference/typeFromPropertyAssignment28.errors.txt @@ -1,5 +1,4 @@ -a.js(7,17): error TS2322: Type '{ q: number; }' is not assignable to type 'C'. - Object literal may only specify known properties, and 'q' does not exist in type 'C'. +a.js(7,17): error TS2353: Object literal may only specify known properties, and 'q' does not exist in type 'C'. a.js(11,3): error TS2339: Property 'q' does not exist on type 'C'. @@ -12,8 +11,7 @@ a.js(11,3): error TS2339: Property 'q' does not exist on type 'C'. // (Object.defineProperty isn't recognised as a JS special assignment right now.) C.prototype = { q: 2 }; ~ -!!! error TS2322: Type '{ q: number; }' is not assignable to type 'C'. -!!! error TS2322: Object literal may only specify known properties, and 'q' does not exist in type 'C'. +!!! error TS2353: Object literal may only specify known properties, and 'q' does not exist in type 'C'. const c = new C() c.p diff --git a/tests/baselines/reference/typeInfer1.errors.txt b/tests/baselines/reference/typeInfer1.errors.txt index 09fc6716aa445..cd16c12130e6e 100644 --- a/tests/baselines/reference/typeInfer1.errors.txt +++ b/tests/baselines/reference/typeInfer1.errors.txt @@ -1,5 +1,4 @@ -typeInfer1.ts(12,5): error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. - Object literal may only specify known properties, and 'Moo' does not exist in type 'ITextWriter2'. +typeInfer1.ts(12,5): error TS2353: Object literal may only specify known properties, and 'Moo' does not exist in type 'ITextWriter2'. ==== typeInfer1.ts (1 errors) ==== @@ -16,6 +15,5 @@ typeInfer1.ts(12,5): error TS2322: Type '{ Moo: () => string; }' is not assignab var yyyyyyyy: ITextWriter2 = { Moo: function() { return "cow"; } ~~~ -!!! error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. -!!! error TS2322: Object literal may only specify known properties, and 'Moo' does not exist in type 'ITextWriter2'. +!!! error TS2353: Object literal may only specify known properties, and 'Moo' does not exist in type 'ITextWriter2'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeMatch2.errors.txt b/tests/baselines/reference/typeMatch2.errors.txt index 0d6600ede2d04..ea28398ac1de9 100644 --- a/tests/baselines/reference/typeMatch2.errors.txt +++ b/tests/baselines/reference/typeMatch2.errors.txt @@ -1,16 +1,13 @@ typeMatch2.ts(3,2): error TS2739: Type '{}' is missing the following properties from type '{ x: number; y: number; }': x, y typeMatch2.ts(4,5): error TS2741: Property 'y' is missing in type '{ x: number; }' but required in type '{ x: number; y: number; }'. -typeMatch2.ts(5,20): error TS2322: Type '{ x: number; y: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. - Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. -typeMatch2.ts(6,17): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. - Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +typeMatch2.ts(5,20): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +typeMatch2.ts(6,17): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. Property 'g' is missing in type 'Animal' but required in type 'Giraffe'. typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. Types of property 'f2' are incompatible. Type 'Animal[]' is not assignable to type 'Giraffe[]'. -typeMatch2.ts(34,26): error TS2322: Type '{ x: number; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. - Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +typeMatch2.ts(34,26): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. typeMatch2.ts(35,5): error TS2741: Property 'y' is missing in type '{ x: number; }' but required in type '{ x: number; y: number; }'. @@ -26,12 +23,10 @@ typeMatch2.ts(35,5): error TS2741: Property 'y' is missing in type '{ x: number; !!! related TS2728 typeMatch2.ts:2:18: 'y' is declared here. a = { x: 1, y: 2, z: 3 }; ~ -!!! error TS2322: Type '{ x: number; y: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. a = { x: 1, z: 3 }; // error ~ -!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. } class Animal { private a; } @@ -69,8 +64,7 @@ typeMatch2.ts(35,5): error TS2741: Property 'y' is missing in type '{ x: number; a = { x: 1, y: _any }; a = { x: 1, y: _any, z:1 }; ~ -!!! error TS2322: Type '{ x: number; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. +!!! error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. a = { x: 1 }; // error ~ !!! error TS2741: Property 'y' is missing in type '{ x: number; }' but required in type '{ x: number; y: number; }'. diff --git a/tests/baselines/reference/typeSatisfaction.errors.txt b/tests/baselines/reference/typeSatisfaction.errors.txt index 31b5a1a737442..21a6d33baf5f7 100644 --- a/tests/baselines/reference/typeSatisfaction.errors.txt +++ b/tests/baselines/reference/typeSatisfaction.errors.txt @@ -1,9 +1,7 @@ -typeSatisfaction.ts(12,20): error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'I1'. - Object literal may only specify known properties, and 'b' does not exist in type 'I1'. +typeSatisfaction.ts(12,20): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'I1'. typeSatisfaction.ts(13,16): error TS1360: Type '{}' does not satisfy the expected type 'I1'. Property 'a' is missing in type '{}' but required in type 'I1'. -typeSatisfaction.ts(24,23): error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'A'. - Object literal may only specify known properties, and 'b' does not exist in type 'A'. +typeSatisfaction.ts(24,23): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'A'. ==== typeSatisfaction.ts (3 errors) ==== @@ -20,8 +18,7 @@ typeSatisfaction.ts(24,23): error TS1360: Type '{ a: string; b: string; }' does const t1 = { a: 1 } satisfies I1; // Ok const t2 = { a: 1, b: 1 } satisfies I1; // Error ~ -!!! error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'I1'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'I1'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'I1'. const t3 = { } satisfies I1; // Error ~~~~~~~~~ !!! error TS1360: Type '{}' does not satisfy the expected type 'I1'. @@ -39,6 +36,5 @@ typeSatisfaction.ts(24,23): error TS1360: Type '{ a: string; b: string; }' does let t7 = { a: 'test' } satisfies A; let t8 = { a: 'test', b: 'test' } satisfies A; ~ -!!! error TS1360: Type '{ a: string; b: string; }' does not satisfy the expected type 'A'. -!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'A'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typeSatisfaction_propNameConstraining.errors.txt b/tests/baselines/reference/typeSatisfaction_propNameConstraining.errors.txt index 7a80d575b6431..a0cb6a25132f9 100644 --- a/tests/baselines/reference/typeSatisfaction_propNameConstraining.errors.txt +++ b/tests/baselines/reference/typeSatisfaction_propNameConstraining.errors.txt @@ -1,5 +1,4 @@ -typeSatisfaction_propNameConstraining.ts(6,5): error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Partial>'. - Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. +typeSatisfaction_propNameConstraining.ts(6,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. typeSatisfaction_propNameConstraining.ts(13,11): error TS2339: Property 'd' does not exist on type '{ a: number; b: string; x: number; }'. @@ -11,8 +10,7 @@ typeSatisfaction_propNameConstraining.ts(13,11): error TS2339: Property 'd' does b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' ~ -!!! error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Partial>'. -!!! error TS1360: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Partial>'. } satisfies Partial>; // Should be OK -- retain info that a is number and b is string diff --git a/tests/baselines/reference/typeSatisfaction_propertyNameFulfillment.errors.txt b/tests/baselines/reference/typeSatisfaction_propertyNameFulfillment.errors.txt index 33a511440e203..32213b6e41b0b 100644 --- a/tests/baselines/reference/typeSatisfaction_propertyNameFulfillment.errors.txt +++ b/tests/baselines/reference/typeSatisfaction_propertyNameFulfillment.errors.txt @@ -1,5 +1,4 @@ -typeSatisfaction_propertyNameFulfillment.ts(6,5): error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Record'. - Object literal may only specify known properties, and 'x' does not exist in type 'Record'. +typeSatisfaction_propertyNameFulfillment.ts(6,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. typeSatisfaction_propertyNameFulfillment.ts(13,11): error TS2339: Property 'd' does not exist on type '{ a: number; b: string; x: number; }'. @@ -11,8 +10,7 @@ typeSatisfaction_propertyNameFulfillment.ts(13,11): error TS2339: Property 'd' d b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' ~ -!!! error TS1360: Type '{ a: number; b: string; x: number; }' does not satisfy the expected type 'Record'. -!!! error TS1360: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Record'. } satisfies Record; // Should be OK -- retain info that a is number and b is string diff --git a/tests/baselines/reference/typeSatisfaction_propertyValueConformance3.errors.txt b/tests/baselines/reference/typeSatisfaction_propertyValueConformance3.errors.txt index 17658512502ab..7df2232680376 100644 --- a/tests/baselines/reference/typeSatisfaction_propertyValueConformance3.errors.txt +++ b/tests/baselines/reference/typeSatisfaction_propertyValueConformance3.errors.txt @@ -1,5 +1,4 @@ -typeSatisfaction_propertyValueConformance3.ts(6,26): error TS2322: Type '{ r: number; g: number; d: number; }' is not assignable to type 'Color'. - Object literal may only specify known properties, and 'd' does not exist in type 'Color'. +typeSatisfaction_propertyValueConformance3.ts(6,26): error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. ==== typeSatisfaction_propertyValueConformance3.ts (1 errors) ==== @@ -10,8 +9,7 @@ typeSatisfaction_propertyValueConformance3.ts(6,26): error TS2322: Type '{ r: nu white: { r: 255, g: 255, b: 255 }, black: { r: 0, g: 0, d: 0 }, // <- oops! 'd' in place of 'b' ~ -!!! error TS2322: Type '{ r: number; g: number; d: number; }' is not assignable to type 'Color'. -!!! error TS2322: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. +!!! error TS2353: Object literal may only specify known properties, and 'd' does not exist in type 'Color'. blue: { r: 0, g: 0, b: 255 }, } satisfies Record; \ No newline at end of file diff --git a/tests/cases/compiler/excessPropertiesInOverloads.ts b/tests/cases/compiler/excessPropertiesInOverloads.ts new file mode 100644 index 0000000000000..895e3045aa32e --- /dev/null +++ b/tests/cases/compiler/excessPropertiesInOverloads.ts @@ -0,0 +1,5 @@ +// @strict: true + +declare function fn(a: { x: string }): void; +declare function fn(a: { y: string }): void; +fn({ z: 3, a: 3 }); diff --git a/tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts b/tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts new file mode 100644 index 0000000000000..a495b5768bbac --- /dev/null +++ b/tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts @@ -0,0 +1,25 @@ +export type Blah = + | { type: "foo", abc: string } + | { type: "bar", xyz: number, extra: any }; + +declare function thing(blah: Blah): void; + +let foo1 = "foo"; +thing({ + type: foo1, + abc: "hello!" +}); + +let foo2 = "foo"; +thing({ + type: foo2, + abc: "hello!", + extra: 123, +}); + +let bar = "bar"; +thing({ + type: bar, + xyz: 123, + extra: 123, +});