Accept diffs that just reduce error elaboration#3183
Accept diffs that just reduce error elaboration#3183RyanCavanaugh wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
This one is:
--- old.arrayCast.errors.txt
+++ new.arrayCast.errors.txt
@@= skipped -0, +0 lines =@@
-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.
- Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'.
+arrayCast.ts(3,23): error TS2353: Object literal may only specify known properties, and 'foo' does not exist in type '{ id: number; }'.It does seems like that top error provides more guidance, and with the new stack, we probably never generate it anymore?
There was a problem hiding this comment.
Let's fix this by adding the error message to the list of ones we don't suppress
There was a problem hiding this comment.
--- old.assignmentCompatability45.errors.txt
+++ new.assignmentCompatability45.errors.txt
@@= skipped -0, +0 lines =@@
assignmentCompatability45.ts(7,7): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
- Types of construct signatures are incompatible.
- Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'.
- Target signature provides too few arguments. Expected 1 or more, but got 0.
+ Target signature provides too few arguments. Expected 1 or more, but got 0.It is unfortunate that we elide the whole stack, so at no point do we actually say what signature typeof B has...
There was a problem hiding this comment.
Let's fix this by adding the error message ("Type of construct signatures are incompatible") to the list of ones we don't suppress
There was a problem hiding this comment.
Pull request overview
Updates the set of “accepted” submodule baseline diffs to allow certain diagnostic output changes where error elaboration is reduced (or error “heads” are skipped), aligning the port’s output with the current behavior while acknowledging the changed diagnostic shape.
Changes:
- Added a new “Skipped error elaboration” group to
testdata/submoduleAccepted.txtand listed the affected.errors.txt.diffbaselines. - Added corresponding reference baseline diff files under
testdata/baselines/reference/submoduleAccepted/{compiler,conformance}/capturing the updated diagnostics.
Reviewed changes
Copilot reviewed 1 out of 54 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| testdata/submoduleAccepted.txt | Adds “Skipped error elaboration” accepted-baseline entries for impacted tests. |
| testdata/baselines/reference/submoduleAccepted/compiler/arrayCast.errors.txt.diff | Accepts updated compiler error output diff for arrayCast. |
| testdata/baselines/reference/submoduleAccepted/compiler/assignmentCompatWithOverloads.errors.txt.diff | Accepts updated compiler error output diff for assignmentCompatWithOverloads. |
| testdata/baselines/reference/submoduleAccepted/compiler/assignmentCompatability44.errors.txt.diff | Accepts updated compiler error output diff for assignmentCompatability44. |
| testdata/baselines/reference/submoduleAccepted/compiler/assignmentCompatability45.errors.txt.diff | Accepts updated compiler error output diff for assignmentCompatability45. |
| testdata/baselines/reference/submoduleAccepted/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt.diff | Accepts updated compiler error output diff for apply-member checking. |
| testdata/baselines/reference/submoduleAccepted/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt.diff | Accepts updated compiler error output diff for call-member checking. |
| testdata/baselines/reference/submoduleAccepted/compiler/bigintWithLib.errors.txt.diff | Accepts updated compiler error output diff for bigintWithLib. |
| testdata/baselines/reference/submoduleAccepted/compiler/classSideInheritance3.errors.txt.diff | Accepts updated compiler error output diff for classSideInheritance3. |
| testdata/baselines/reference/submoduleAccepted/compiler/computedPropertyBindingElementDeclarationNoCrash1.errors.txt.diff | Accepts updated compiler error output diff for computed-property binding element case. |
| testdata/baselines/reference/submoduleAccepted/compiler/constraints0.errors.txt.diff | Accepts updated compiler error output diff for constraints0. |
| testdata/baselines/reference/submoduleAccepted/compiler/differentTypesWithSameName.errors.txt.diff | Accepts updated compiler error output diff for differentTypesWithSameName. |
| testdata/baselines/reference/submoduleAccepted/compiler/excessPropertyCheckWithUnions.errors.txt.diff | Accepts updated compiler error output diff for excessPropertyCheckWithUnions. |
| testdata/baselines/reference/submoduleAccepted/compiler/genericConstraint2.errors.txt.diff | Accepts updated compiler error output diff for genericConstraint2. |
| testdata/baselines/reference/submoduleAccepted/compiler/genericTypeConstraints.errors.txt.diff | Accepts updated compiler error output diff for genericTypeConstraints. |
| testdata/baselines/reference/submoduleAccepted/compiler/generics1.errors.txt.diff | Accepts updated compiler error output diff for generics1. |
| testdata/baselines/reference/submoduleAccepted/compiler/generics2.errors.txt.diff | Accepts updated compiler error output diff for generics2. |
| testdata/baselines/reference/submoduleAccepted/compiler/generics5.errors.txt.diff | Accepts updated compiler error output diff for generics5. |
| testdata/baselines/reference/submoduleAccepted/compiler/inferenceFromIncompleteSource.errors.txt.diff | Accepts updated compiler error output diff for inferenceFromIncompleteSource. |
| testdata/baselines/reference/submoduleAccepted/compiler/mappedTypeAsStringTemplate.errors.txt.diff | Accepts updated compiler error output diff for mappedTypeAsStringTemplate. |
| testdata/baselines/reference/submoduleAccepted/compiler/noParameterReassignmentJSIIFE.errors.txt.diff | Accepts updated compiler error output diff for noParameterReassignmentJSIIFE. |
| testdata/baselines/reference/submoduleAccepted/compiler/objectLiteralFunctionArgContextualTyping2.errors.txt.diff | Accepts updated compiler error output diff for contextual typing case. |
| testdata/baselines/reference/submoduleAccepted/compiler/objectLiteralThisWidenedOnUse.errors.txt.diff | Accepts updated compiler error output diff for objectLiteralThisWidenedOnUse. |
| testdata/baselines/reference/submoduleAccepted/compiler/recursiveClassReferenceTest.errors.txt.diff | Accepts updated compiler error output diff for recursiveClassReferenceTest. |
| testdata/baselines/reference/submoduleAccepted/compiler/templateStringsArrayTypeDefinedInES5Mode(target=es2015).errors.txt.diff | Accepts updated compiler error output diff for template strings array type (defined). |
| testdata/baselines/reference/submoduleAccepted/compiler/templateStringsArrayTypeNotDefinedES5Mode(target=es2015).errors.txt.diff | Accepts updated compiler error output diff for template strings array type (not defined). |
| testdata/baselines/reference/submoduleAccepted/compiler/templateStringsArrayTypeRedefinedInES6Mode.errors.txt.diff | Accepts updated compiler error output diff for template strings array type (redefined). |
| testdata/baselines/reference/submoduleAccepted/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt.diff | Accepts updated compiler error output diff for constraint/common-root inference. |
| testdata/baselines/reference/submoduleAccepted/conformance/decoratorOnClassMethod10(target=es2015).errors.txt.diff | Accepts updated conformance error output diff for decorator method case. |
| testdata/baselines/reference/submoduleAccepted/conformance/destructuringParameterDeclaration2.errors.txt.diff | Accepts updated conformance error output diff for destructuring parameter case (2). |
| testdata/baselines/reference/submoduleAccepted/conformance/destructuringParameterDeclaration5.errors.txt.diff | Accepts updated conformance error output diff for destructuring parameter case (5). |
| testdata/baselines/reference/submoduleAccepted/conformance/es2020IntlAPIs.errors.txt.diff | Accepts updated conformance error output diff for ES2020 Intl APIs. |
| testdata/baselines/reference/submoduleAccepted/conformance/genericCallWithObjectTypeArgsAndConstraints4.errors.txt.diff | Accepts updated conformance error output diff for generic call constraints (4). |
| testdata/baselines/reference/submoduleAccepted/conformance/genericCallWithObjectTypeArgsAndConstraints5.errors.txt.diff | Accepts updated conformance error output diff for generic call constraints (5). |
| testdata/baselines/reference/submoduleAccepted/conformance/iterableArrayPattern17.errors.txt.diff | Accepts updated conformance error output diff for iterable array pattern (17). |
| testdata/baselines/reference/submoduleAccepted/conformance/iterableArrayPattern18.errors.txt.diff | Accepts updated conformance error output diff for iterable array pattern (18). |
| testdata/baselines/reference/submoduleAccepted/conformance/iterableArrayPattern19.errors.txt.diff | Accepts updated conformance error output diff for iterable array pattern (19). |
| testdata/baselines/reference/submoduleAccepted/conformance/mappedTypeConstraints2.errors.txt.diff | Accepts updated conformance error output diff for mapped type constraints (2). |
| testdata/baselines/reference/submoduleAccepted/conformance/narrowingGenericTypeFromInstanceof01.errors.txt.diff | Accepts updated conformance error output diff for generic narrowing via instanceof. |
| testdata/baselines/reference/submoduleAccepted/conformance/noInfer.errors.txt.diff | Accepts updated conformance error output diff for noInfer. |
| testdata/baselines/reference/submoduleAccepted/conformance/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt.diff | Accepts updated conformance error output diff for object literal shorthand arg case. |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithNumericIndexer2.errors.txt.diff | Accepts updated conformance error output diff for numeric indexer subtyping (2). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithNumericIndexer3.errors.txt.diff | Accepts updated conformance error output diff for numeric indexer subtyping (3). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithNumericIndexer4.errors.txt.diff | Accepts updated conformance error output diff for numeric indexer subtyping (4). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithNumericIndexer5.errors.txt.diff | Accepts updated conformance error output diff for numeric indexer subtyping (5). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithStringIndexer2.errors.txt.diff | Accepts updated conformance error output diff for string indexer subtyping (2). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithStringIndexer3.errors.txt.diff | Accepts updated conformance error output diff for string indexer subtyping (3). |
| testdata/baselines/reference/submoduleAccepted/conformance/subtypingWithStringIndexer4.errors.txt.diff | Accepts updated conformance error output diff for string indexer subtyping (4). |
| testdata/baselines/reference/submoduleAccepted/conformance/thisTypeInFunctionsNegative.errors.txt.diff | Accepts updated conformance error output diff for negative this typing in functions. |
| testdata/baselines/reference/submoduleAccepted/conformance/typeSatisfaction.errors.txt.diff | Accepts updated conformance error output diff for satisfies type satisfaction. |
| testdata/baselines/reference/submoduleAccepted/conformance/typeSatisfactionWithDefaultExport.errors.txt.diff | Accepts updated conformance error output diff for satisfies + default export. |
| testdata/baselines/reference/submoduleAccepted/conformance/typeSatisfaction_errorLocations1.errors.txt.diff | Accepts updated conformance error output diff for satisfies error locations. |
| testdata/baselines/reference/submoduleAccepted/conformance/typedefMultipleTypeParameters.errors.txt.diff | Accepts updated conformance error output diff for typedef multiple type params. |
| testdata/baselines/reference/submoduleAccepted/conformance/unionTypeCallSignatures6.errors.txt.diff | Accepts updated conformance error output diff for union call signatures case. |
Comments suppressed due to low confidence (1)
testdata/submoduleAccepted.txt:117
- These accepted baseline entries don't have corresponding files under testdata/baselines/reference/submoduleAccepted/conformance/. Both
usingDeclarations.14.errors.txt.diffandusingDeclarationsWithIteratorObject.errors.txt.diffare listed here but the diff files are missing, which will cause the accepted baseline list to reference non-existent baselines. Add the missing.errors.txt.difffiles or remove/correct these entries.
| conformance/genericCallWithObjectTypeArgsAndConstraints5.errors.txt.diff | ||
| conformance/instanceofOperatorWithInvalidOperands.es2015.errors.txt.diff | ||
| conformance/iterableArrayPattern17.errors.txt.diff |
There was a problem hiding this comment.
These accepted baseline entries don't have corresponding files under testdata/baselines/reference/submoduleAccepted/conformance/. Currently instanceofOperatorWithInvalidOperands.es2015.errors.txt.diff is listed here but the diff file is missing, so the submoduleAccepted baseline set will reference a non-existent baseline. Add the missing .errors.txt.diff file(s) or remove/correct this entry.
This issue also appears on line 116 of the same file.
There was a problem hiding this comment.
declare var e: Elephant;
f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal
~
-!!! error TS2345: Argument of type 'Elephant' is not assignable to parameter of type 'Giraffe'.
-!!! error TS2345: Property 'y' is missing in type 'Elephant' but required in type 'Giraffe'.
+!!! error TS2741: Property 'y' is missing in type 'Elephant' but required in type 'Giraffe'.
!!! related TS2728 typeArgumentInferenceWithConstraintAsCommonRoot.ts:2:36: 'y' is declared here.Not mega thrilled we don't clearly identify which type is the arg and which is the parameter...
There was a problem hiding this comment.
Let's raise this in a meeting and accept for now
There was a problem hiding this comment.
--- old.constraints0.errors.txt
+++ new.constraints0.errors.txt
@@= skipped -0, +0 lines =@@
-constraints0.ts(14,19): error TS2344: Type 'B' does not satisfy the constraint 'A'.
- Property 'a' is missing in type 'B' but required in type 'A'.
+constraints0.ts(14,19): error TS2741: Property 'a' is missing in type 'B' but required in type 'A'.This is one of those things I think there was disagreement about. I think it's a bummer to lose the word "constraint" here, but...
There was a problem hiding this comment.
Let's raise this in a meeting and accept for now
...erence/submoduleAccepted/conformance/decoratorOnClassMethod10(target=es2015).errors.txt.diff
Show resolved
Hide resolved
… and restore regex checking section Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> Agent-Logs-Url: https://github.com/RyanCavanaugh/typescript-go/sessions/77b2428b-ab83-4307-9d7b-63b4a05343e4
There are a few remaining baselines that show this behavior, but where I felt the error quality was substantially worsened by skipping the error heads: