diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 64e7ca0a816..17eaf34b0a3 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -21464,7 +21464,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol);
const entry = enumRelation.get(id);
- if (entry !== undefined && !(!(entry & RelationComparisonResult.Reported) && entry & RelationComparisonResult.Failed && errorReporter)) {
+ if (entry !== undefined && !(entry & RelationComparisonResult.Failed && errorReporter)) {
return !!(entry & RelationComparisonResult.Succeeded);
}
const targetEnumType = getTypeOfSymbol(targetSymbol);
@@ -21474,11 +21474,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (!targetProperty || !(targetProperty.flags & SymbolFlags.EnumMember)) {
if (errorReporter) {
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType));
- enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported);
- }
- else {
- enumRelation.set(id, RelationComparisonResult.Failed);
}
+ enumRelation.set(id, RelationComparisonResult.Failed);
return false;
}
const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, SyntaxKind.EnumMember)!).value;
@@ -21489,15 +21486,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// If we have 2 enums with *known* values that differ, they are incompatible.
if (sourceValue !== undefined && targetValue !== undefined) {
- if (!errorReporter) {
- enumRelation.set(id, RelationComparisonResult.Failed);
- }
- else {
+ if (errorReporter) {
const escapedSource = sourceIsString ? `"${escapeString(sourceValue)}"` : sourceValue;
const escapedTarget = targetIsString ? `"${escapeString(targetValue)}"` : targetValue;
errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
- enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported);
}
+ enumRelation.set(id, RelationComparisonResult.Failed);
return false;
}
@@ -21508,16 +21502,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// Either way, we can assume that it's numeric.
// If the other is a string, we have a mismatch in types.
if (sourceIsString || targetIsString) {
- if (!errorReporter) {
- enumRelation.set(id, RelationComparisonResult.Failed);
- }
- else {
+ if (errorReporter) {
const knownStringValue = sourceValue ?? targetValue;
Debug.assert(typeof knownStringValue === "string");
const escapedValue = `"${escapeString(knownStringValue)}"`;
errorReporter(Diagnostics.One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value, symbolName(targetSymbol), symbolName(targetProperty), escapedValue);
- enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported);
}
+ enumRelation.set(id, RelationComparisonResult.Failed);
return false;
}
}
@@ -21716,7 +21707,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (overflow) {
// Record this relation as having failed such that we don't attempt the overflowing operation again.
const id = getRelationKey(source, target, /*intersectionState*/ IntersectionState.None, relation, /*ignoreConstraints*/ false);
- relation.set(id, RelationComparisonResult.Reported | RelationComparisonResult.Failed);
+ relation.set(id, RelationComparisonResult.Failed | (relationCount <= 0 ? RelationComparisonResult.ComplexityOverflow : RelationComparisonResult.StackDepthOverflow));
tracing?.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
const message = relationCount <= 0 ?
Diagnostics.Excessive_complexity_comparing_types_0_and_1 :
@@ -22617,9 +22608,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const id = getRelationKey(source, target, intersectionState, relation, /*ignoreConstraints*/ false);
const entry = relation.get(id);
if (entry !== undefined) {
- if (reportErrors && entry & RelationComparisonResult.Failed && !(entry & RelationComparisonResult.Reported)) {
- // We are elaborating errors and the cached result is an unreported failure. The result will be reported
- // as a failure, and should be updated as a reported failure by the bottom of this function.
+ if (reportErrors && entry & RelationComparisonResult.Failed && !(entry & RelationComparisonResult.Overflow)) {
+ // We are elaborating errors and the cached result is a failure not due to a comparison overflow,
+ // so we will do the comparison again to generate an error message.
}
else {
if (outofbandVarianceMarkerHandler) {
@@ -22632,6 +22623,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
instantiateType(source, reportUnreliableMapper);
}
}
+ if (reportErrors && entry & RelationComparisonResult.Overflow) {
+ const message = entry & RelationComparisonResult.ComplexityOverflow ?
+ Diagnostics.Excessive_complexity_comparing_types_0_and_1 :
+ Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
+ reportError(message, typeToString(source), typeToString(target));
+ overrideNextErrorInfo++;
+ }
return entry & RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
}
}
@@ -22735,7 +22733,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
else {
// A false result goes straight into global cache (when something is false under
// assumptions it will also be false without assumptions)
- relation.set(id, (reportErrors ? RelationComparisonResult.Reported : 0) | RelationComparisonResult.Failed | propagatingVarianceFlags);
+ relation.set(id, RelationComparisonResult.Failed | propagatingVarianceFlags);
relationCount--;
resetMaybeStack(/*markAllAsSucceeded*/ false);
}
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 6d8a864c30f..de1d15c4385 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -913,11 +913,14 @@ export const enum RelationComparisonResult {
None = 0,
Succeeded = 1 << 0, // Should be truthy
Failed = 1 << 1,
- Reported = 1 << 2,
ReportsUnmeasurable = 1 << 3,
ReportsUnreliable = 1 << 4,
ReportsMask = ReportsUnmeasurable | ReportsUnreliable,
+
+ ComplexityOverflow = 1 << 5,
+ StackDepthOverflow = 1 << 6,
+ Overflow = ComplexityOverflow | StackDepthOverflow,
}
/** @internal */
diff --git a/tests/baselines/reference/arrayFrom.errors.txt b/tests/baselines/reference/arrayFrom.errors.txt
index 62f3045196e..db80bc19f5b 100644
--- a/tests/baselines/reference/arrayFrom.errors.txt
+++ b/tests/baselines/reference/arrayFrom.errors.txt
@@ -1,6 +1,7 @@
arrayFrom.ts(20,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'.
Property 'b' is missing in type 'A' but required in type 'B'.
arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'.
+ Property 'b' is missing in type 'A' but required in type 'B'.
==== arrayFrom.ts (2 errors) ====
@@ -33,6 +34,8 @@ arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'.
const result6: B[] = Array.from(inputALike); // expect error
~~~~~~~
!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'.
+!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 arrayFrom.ts:9:3: 'b' is declared here.
const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a }));
const result8: A[] = Array.from(inputARand);
const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a }));
diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt
index 1b2f7b62be0..0c485b9253c 100644
--- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt
+++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt
@@ -3,7 +3,7 @@ arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is
arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is not assignable to type 'readonly B[]'.
The types returned by 'concat(...)' are incompatible between these types.
Type 'A[]' is not assignable to type 'B[]'.
- Type 'A' is not assignable to type 'B'.
+ Property 'b' is missing in type 'A' but required in type 'B'.
==== arrayOfSubtypeIsAssignableToReadonlyArray.ts (2 errors) ====
@@ -33,5 +33,6 @@ arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is
!!! error TS2322: Type 'C' is not assignable to type 'readonly B[]'.
!!! error TS2322: The types returned by 'concat(...)' are incompatible between these types.
!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'.
-!!! error TS2322: Type 'A' is not assignable to type 'B'.
+!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 arrayOfSubtypeIsAssignableToReadonlyArray.ts:2:21: 'b' is declared here.
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
index 60335630beb..f990fc308dc 100644
--- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
@@ -11,7 +11,7 @@ assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]:
assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
'number' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'.
'number' index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
@@ -19,7 +19,7 @@ assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]:
assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
'number' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
==== assignmentCompatWithNumericIndexer.ts (6 errors) ====
@@ -74,7 +74,8 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2322: 'number' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithNumericIndexer.ts:4:34: 'bar' is declared here.
var b2: { [x: number]: Derived2; }
a = b2; // error
@@ -88,7 +89,7 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2322: 'number' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
var b3: { [x: number]: T; }
a = b3; // ok
diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt
index 019fcf237be..0afe61148c6 100644
--- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt
@@ -11,7 +11,7 @@ assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]:
assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
'number' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'.
'number' index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
@@ -19,7 +19,7 @@ assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]:
assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
'number' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
==== assignmentCompatWithNumericIndexer2.ts (6 errors) ====
@@ -74,7 +74,8 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not a
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'.
!!! error TS2322: 'number' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithNumericIndexer2.ts:4:34: 'bar' is declared here.
var b2: { [x: number]: Derived2; }
a = b2; // error
@@ -88,7 +89,7 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not a
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
!!! error TS2322: 'number' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
var b3: { [x: number]: T; }
a = b3; // ok
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
index 861a8174328..72885e82376 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
@@ -6,49 +6,49 @@ assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assig
Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2'.
Types of property 'foo' are incompatible.
- Type 'Derived' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
- Type 'Derived' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
- Type 'Derived' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
- Type 'Derived2' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'.
Types of property 'foo' are incompatible.
Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2'.
Types of property 'foo' are incompatible.
- Type 'Base' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
- Type 'Base' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
Types of property 'foo' are incompatible.
- Type 'Base' is not assignable to type 'Derived2'.
+ Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
==== assignmentCompatWithObjectMembers4.ts (17 errors) ====
@@ -94,34 +94,40 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
~~
!!! error TS2322: Type 'T2' is not assignable to type 'S2'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
t2 = s2; // error
~~
!!! error TS2322: Type 'S2' is not assignable to type 'T2'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:6:35: 'baz' is declared here.
s2 = t; // error
~~
!!! error TS2322: Type 'T' is not assignable to type 'S2'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
s2 = b; // error
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
s2 = a2; // ok
a = b; // error
~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
b = a; // error
~
!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:6:35: 'baz' is declared here.
a = s; // ok
a = s2; // ok
a = a2; // ok
@@ -130,27 +136,32 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
b2 = a2; // error
~~
!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Derived' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:6:35: 'baz' is declared here.
a2 = b; // error
~~
!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
a2 = t2; // error
~~
!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
a2 = t; // error
~~
!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:5:34: 'bar' is declared here.
}
module WithBase {
@@ -189,7 +200,8 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
~~
!!! error TS2322: Type 'S2' is not assignable to type 'T2'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:51:35: 'baz' is declared here.
s2 = t; // ok
s2 = b; // ok
s2 = a2; // ok
@@ -199,7 +211,8 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
~
!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:51:35: 'baz' is declared here.
a = s; // ok
a = s2; // ok
a = a2; // ok
@@ -209,7 +222,8 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
~~
!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
+!!! related TS2728 assignmentCompatWithObjectMembers4.ts:51:35: 'baz' is declared here.
a2 = b; // ok
a2 = t2; // ok
a2 = t; // ok
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
index 654349412cc..1a1a1012004 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
@@ -17,6 +17,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D'
assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
+ Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'.
@@ -26,11 +27,15 @@ assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D'
assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'.
Types have separate declarations of a private property 'foo'.
assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
+ Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'.
+ Property 'foo' is private in type 'Base' but not in type 'D'.
assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'.
+ Types have separate declarations of a private property 'foo'.
assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'.
Property 'foo' is private in type 'Base' but not in type 'D'.
assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'.
+ Property 'foo' is private in type 'Base' but not in type 'D'.
assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'.
Property 'foo' is private in type 'E' but not in type 'D'.
assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
@@ -38,6 +43,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{
assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'.
Types have separate declarations of a private property 'foo'.
assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'.
+ Types have separate declarations of a private property 'foo'.
assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
@@ -154,6 +160,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
a = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
+!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
a = d;
a = e; // error
~
@@ -178,13 +185,16 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
i = a; // error
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
+!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
i = b;
i = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'I'.
+!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
i = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'I'.
+!!! error TS2322: Types have separate declarations of a private property 'foo'.
i = i;
d = a;
@@ -195,6 +205,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
d = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type 'D'.
+!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
d = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'D'.
@@ -211,6 +222,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
e = i; // errror
~
!!! error TS2322: Type 'I' is not assignable to type 'E'.
+!!! error TS2322: Types have separate declarations of a private property 'foo'.
e = d; // errror
~
!!! error TS2322: Type 'D' is not assignable to type 'E'.
diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
index cb6e1cf7a01..ea6734d5a86 100644
--- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
@@ -6,10 +6,10 @@ assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assign
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'.
'string' index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
@@ -17,7 +17,7 @@ assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: D
assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'.
'string' index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
@@ -25,7 +25,7 @@ assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: D
assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
==== assignmentCompatWithStringIndexer.ts (8 errors) ====
@@ -74,7 +74,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2322: 'string' index signatures are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithStringIndexer.ts:4:34: 'bar' is declared here.
class B2 extends A {
[x: string]: Derived2; // ok
@@ -86,7 +87,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2322: 'string' index signatures are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
function foo() {
var b3: { [x: string]: Derived; };
@@ -102,7 +103,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2322: 'string' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithStringIndexer.ts:4:34: 'bar' is declared here.
var b4: { [x: string]: Derived2; };
a3 = b4; // error
@@ -116,6 +118,6 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2322: 'string' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
}
}
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
index 5f76ae541c9..c330a9fa38b 100644
--- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
@@ -6,10 +6,10 @@ assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assig
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'.
'string' index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
@@ -17,7 +17,7 @@ assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]:
assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived'.
- Type 'Base' is not assignable to type 'Derived'.
+ Property 'bar' is missing in type 'Base' but required in type 'Derived'.
assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'.
'string' index signatures are incompatible.
Type 'Derived2' is not assignable to type 'T'.
@@ -25,7 +25,7 @@ assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]:
assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
Type 'T' is not assignable to type 'Derived2'.
- Type 'Base' is not assignable to type 'Derived2'.
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
==== assignmentCompatWithStringIndexer2.ts (8 errors) ====
@@ -74,7 +74,8 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2322: 'string' index signatures are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithStringIndexer2.ts:4:34: 'bar' is declared here.
interface B2 extends A {
[x: string]: Derived2; // ok
@@ -86,7 +87,7 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
~~
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2322: 'string' index signatures are incompatible.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
function foo() {
var b3: { [x: string]: Derived; };
@@ -102,7 +103,8 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
!!! error TS2322: 'string' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
+!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
+!!! related TS2728 assignmentCompatWithStringIndexer2.ts:4:34: 'bar' is declared here.
var b4: { [x: string]: Derived2; };
a3 = b4; // error
@@ -116,6 +118,6 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
!!! error TS2322: 'string' index signatures are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
-!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
}
}
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt
index 3816de11cc0..c632f41dba0 100644
--- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt
@@ -4,6 +4,7 @@ assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1)
assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2741: Property 'apply' is missing in type '{}' but required in type 'Applicable'.
assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'.
assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'.
+ Property 'apply' is missing in type 'string[]' but required in type 'Applicable'.
assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'.
assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'.
Property 'apply' is missing in type '{}' but required in type 'Applicable'.
@@ -47,6 +48,8 @@ assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4)
fn(['']);
~~~~
!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'.
+!!! error TS2345: Property 'apply' is missing in type 'string[]' but required in type 'Applicable'.
+!!! related TS2728 assignmentCompatability_checking-apply-member-off-of-function-interface.ts:4:5: 'apply' is declared here.
fn(4);
~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'.
diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt
index 5937ea7e1b3..c294e804251 100644
--- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt
@@ -4,6 +4,7 @@ assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1):
assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2741: Property 'call' is missing in type '{}' but required in type 'Callable'.
assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'.
assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'.
+ Property 'call' is missing in type 'string[]' but required in type 'Callable'.
assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'.
assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'.
Property 'call' is missing in type '{}' but required in type 'Callable'.
@@ -47,6 +48,8 @@ assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4):
fn(['']);
~~~~
!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'.
+!!! error TS2345: Property 'call' is missing in type 'string[]' but required in type 'Callable'.
+!!! related TS2728 assignmentCompatability_checking-call-member-off-of-function-interface.ts:4:5: 'call' is declared here.
fn(4);
~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'.
diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt
index aa402ec0cba..74057e3a243 100644
--- a/tests/baselines/reference/bigintWithLib.errors.txt
+++ b/tests/baselines/reference/bigintWithLib.errors.txt
@@ -18,8 +18,14 @@ bigintWithLib.ts(31,35): error TS2769: No overload matches this call.
Argument of type 'number[]' is not assignable to parameter of type 'number'.
Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'Iterable'.
+ The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
+ Type 'IteratorResult' is not assignable to type 'IteratorResult'.
+ Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'.
+ Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'.
+ Type 'number' is not assignable to type 'bigint'.
Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'.
+ Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
bigintWithLib.ts(36,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
bigintWithLib.ts(43,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'.
bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'.
@@ -81,8 +87,14 @@ bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignab
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! error TS2769: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'.
+!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
+!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'.
+!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'.
+!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'.
+!!! error TS2769: Type 'number' is not assignable to type 'bigint'.
!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'.
+!!! error TS2769: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
bigUintArray = new BigUint64Array(new ArrayBuffer(80));
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3);
diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt
index 16cbceb4748..0a2b933f57d 100644
--- a/tests/baselines/reference/castingTuple.errors.txt
+++ b/tests/baselines/reference/castingTuple.errors.txt
@@ -3,6 +3,7 @@ castingTuple.ts(13,23): error TS2352: Conversion of type '[number, string]' to t
castingTuple.ts(14,15): error TS2352: Conversion of type '[number, string, boolean]' to type '[number, string]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Source has 3 element(s) but target allows only 2.
castingTuple.ts(15,14): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
+ Source has 2 element(s) but target requires 3.
castingTuple.ts(18,21): error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Source has 2 element(s) but target requires 3.
castingTuple.ts(20,33): error TS2493: Tuple type '[C, D, A]' of length '3' has no element at index '5'.
@@ -40,6 +41,7 @@ castingTuple.ts(33,1): error TS2304: Cannot find name 't4'.
var longer = numStrTuple as [number, string, boolean]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
+!!! error TS2352: Source has 2 element(s) but target requires 3.
var classCDTuple: [C, D] = [new C(), new D()];
var interfaceIITuple = <[I, I]>classCDTuple;
var classCDATuple = <[C, D, A]>classCDTuple;
diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt
index fad32e7ea26..7892dd2bd4b 100644
--- a/tests/baselines/reference/chainedAssignment1.errors.txt
+++ b/tests/baselines/reference/chainedAssignment1.errors.txt
@@ -1,6 +1,6 @@
chainedAssignment1.ts(21,1): error TS2741: Property 'a' is missing in type 'Z' but required in type 'X'.
chainedAssignment1.ts(21,6): error TS2739: Type 'Z' is missing the following properties from type 'Y': a, b
-chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y'.
+chainedAssignment1.ts(22,1): error TS2739: Type 'Z' is missing the following properties from type 'Y': a, b
==== chainedAssignment1.ts (3 errors) ====
@@ -32,4 +32,4 @@ chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y
!!! error TS2739: Type 'Z' is missing the following properties from type 'Y': a, b
c2 = c3; // Error TS111: Cannot convert Z to Y
~~
-!!! error TS2322: Type 'Z' is not assignable to type 'Y'.
\ No newline at end of file
+!!! error TS2739: Type 'Z' is missing the following properties from type 'Y': a, b
\ No newline at end of file
diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt
index b33f6d87a2c..81f05df13d7 100644
--- a/tests/baselines/reference/chainedAssignment3.errors.txt
+++ b/tests/baselines/reference/chainedAssignment3.errors.txt
@@ -1,5 +1,5 @@
chainedAssignment3.ts(18,1): error TS2741: Property 'value' is missing in type 'A' but required in type 'B'.
-chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B'.
+chainedAssignment3.ts(19,5): error TS2741: Property 'value' is missing in type 'A' but required in type 'B'.
==== chainedAssignment3.ts (2 errors) ====
@@ -26,7 +26,8 @@ chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B
!!! related TS2728 chainedAssignment3.ts:6:5: 'value' is declared here.
a = b = new A();
~
-!!! error TS2322: Type 'A' is not assignable to type 'B'.
+!!! error TS2741: Property 'value' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 chainedAssignment3.ts:6:5: 'value' is declared here.
\ No newline at end of file
diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt
index 5736290f8a1..cc60334c1e3 100644
--- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt
+++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt
@@ -8,6 +8,7 @@ checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches thi
Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'.
Types of property 'children' are incompatible.
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
+ Source has 3 element(s) but target allows only 2.
==== checkJsxChildrenCanBeTupleType.tsx (1 errors) ====
@@ -39,6 +40,7 @@ checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches thi
!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'.
!!! error TS2769: Types of property 'children' are incompatible.
!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
+!!! error TS2769: Source has 3 element(s) but target allows only 2.
diff --git a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt
index 8a32b0c5807..7c65a0c335a 100644
--- a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt
+++ b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt
@@ -7,6 +7,9 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+ Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+ Type 'GetProps[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+ Type 'GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
==== circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ====
@@ -83,4 +86,7 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+!!! error TS2344: Type 'GetProps[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
+!!! error TS2344: Type 'GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'.
\ No newline at end of file
diff --git a/tests/baselines/reference/classPropertyErrorOnNameOnly.errors.txt b/tests/baselines/reference/classPropertyErrorOnNameOnly.errors.txt
index dd476a60fe7..a56ad9e9caf 100644
--- a/tests/baselines/reference/classPropertyErrorOnNameOnly.errors.txt
+++ b/tests/baselines/reference/classPropertyErrorOnNameOnly.errors.txt
@@ -3,6 +3,7 @@ classPropertyErrorOnNameOnly.ts(7,3): error TS2322: Type '(val: Values) => "1" |
Type 'undefined' is not assignable to type 'string'.
classPropertyErrorOnNameOnly.ts(24,7): error TS2322: Type '(val: Values) => "1" | "2" | "3" | "4" | "5" | undefined' is not assignable to type 'FuncType'.
Type 'string | undefined' is not assignable to type 'string'.
+ Type 'undefined' is not assignable to type 'string'.
==== classPropertyErrorOnNameOnly.ts (2 errors) ====
@@ -37,6 +38,7 @@ classPropertyErrorOnNameOnly.ts(24,7): error TS2322: Type '(val: Values) => "1"
~~~~~~~~~~~~
!!! error TS2322: Type '(val: Values) => "1" | "2" | "3" | "4" | "5" | undefined' is not assignable to type 'FuncType'.
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
+!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
switch (val) {
case 1:
return "1";
diff --git a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt
index 7d80efe6b38..0ee31ce889f 100644
--- a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt
+++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt
@@ -5,18 +5,23 @@ complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts(33,5): error TS2322
Type 'string' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'.
Type 'string' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'.
Type 'string' is not assignable to type 'ChannelOfType["type"]'.
- Type 'T' is not assignable to type 'ChannelOfType["type"]'.
- Type 'string' is not assignable to type 'ChannelOfType["type"]'.
- Type 'string' is not assignable to type 'ChannelOfType["type"]'.
- Type '"text"' is not assignable to type 'T & "text"'.
- Type 'T' is not assignable to type 'T & "text"'.
- Type '"text" | "email"' is not assignable to type 'T & "text"'.
+ Type '"text"' is not assignable to type 'T & "text"'.
+ Type '"text"' is not assignable to type 'T'.
+ '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
+ Type 'T' is not assignable to type 'ChannelOfType["type"]'.
+ Type 'string' is not assignable to type 'ChannelOfType["type"]'.
+ Type 'string' is not assignable to type 'ChannelOfType["type"]'.
Type '"text"' is not assignable to type 'T & "text"'.
Type '"text"' is not assignable to type 'T'.
'"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
- Type 'T' is not assignable to type '"text"'.
- Type '"text" | "email"' is not assignable to type '"text"'.
- Type '"email"' is not assignable to type '"text"'.
+ Type 'T' is not assignable to type 'T & "text"'.
+ Type '"text" | "email"' is not assignable to type 'T & "text"'.
+ Type '"text"' is not assignable to type 'T & "text"'.
+ Type '"text"' is not assignable to type 'T'.
+ '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
+ Type 'T' is not assignable to type '"text"'.
+ Type '"text" | "email"' is not assignable to type '"text"'.
+ Type '"email"' is not assignable to type '"text"'.
==== complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts (1 errors) ====
@@ -61,18 +66,23 @@ complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts(33,5): error TS2322
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'.
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'.
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"]'.
-!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType["type"]'.
-!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"]'.
-!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"]'.
-!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
-!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
-!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'.
+!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
+!!! error TS2322: Type '"text"' is not assignable to type 'T'.
+!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
+!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType["type"]'.
+!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"]'.
+!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
-!!! error TS2322: Type 'T' is not assignable to type '"text"'.
-!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
-!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
+!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
+!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'.
+!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
+!!! error TS2322: Type '"text"' is not assignable to type 'T'.
+!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
+!!! error TS2322: Type 'T' is not assignable to type '"text"'.
+!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
+!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
}
const newTextChannel = makeNewChannel('text');
diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt
index ea66f14d927..aa2ae24033b 100644
--- a/tests/baselines/reference/conditionalTypes1.errors.txt
+++ b/tests/baselines/reference/conditionalTypes1.errors.txt
@@ -37,20 +37,28 @@ conditionalTypes1.ts(108,5): error TS2322: Type 'FunctionProperties' is not a
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
Type 'keyof T' is not assignable to type 'never'.
+ Type 'string | number | symbol' is not assignable to type 'never'.
+ Type 'string' is not assignable to type 'never'.
conditionalTypes1.ts(114,5): error TS2322: Type 'keyof T' is not assignable to type 'FunctionPropertyNames'.
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
conditionalTypes1.ts(115,5): error TS2322: Type 'NonFunctionPropertyNames' is not assignable to type 'FunctionPropertyNames'.
Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
- Type 'keyof T' is not assignable to type 'never'.
- Type 'string | number | symbol' is not assignable to type 'never'.
- Type 'string' is not assignable to type 'never'.
+ Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
+ Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
+ Type 'keyof T' is not assignable to type 'never'.
+ Type 'string | number | symbol' is not assignable to type 'never'.
+ Type 'string' is not assignable to type 'never'.
conditionalTypes1.ts(116,5): error TS2322: Type 'keyof T' is not assignable to type 'NonFunctionPropertyNames'.
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
conditionalTypes1.ts(117,5): error TS2322: Type 'FunctionPropertyNames' is not assignable to type 'NonFunctionPropertyNames'.
Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
- Type 'keyof T' is not assignable to type 'never'.
+ Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
+ Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
+ Type 'keyof T' is not assignable to type 'never'.
+ Type 'string | number | symbol' is not assignable to type 'never'.
+ Type 'string' is not assignable to type 'never'.
conditionalTypes1.ts(134,10): error TS2540: Cannot assign to 'id' because it is a read-only property.
conditionalTypes1.ts(135,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading.
conditionalTypes1.ts(136,22): error TS2540: Cannot assign to 'id' because it is a read-only property.
@@ -229,6 +237,8 @@ conditionalTypes1.ts(288,43): error TS2322: Type 'T95' is not assignable to t
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
!!! error TS2322: Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
+!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'never'.
+!!! error TS2322: Type 'string' is not assignable to type 'never'.
}
function f8(x: keyof T, y: FunctionPropertyNames, z: NonFunctionPropertyNames) {
@@ -243,9 +253,11 @@ conditionalTypes1.ts(288,43): error TS2322: Type 'T95' is not assignable to t
~
!!! error TS2322: Type 'NonFunctionPropertyNames' is not assignable to type 'FunctionPropertyNames'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
-!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
-!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'never'.
-!!! error TS2322: Type 'string' is not assignable to type 'never'.
+!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
+!!! error TS2322: Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
+!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
+!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'never'.
+!!! error TS2322: Type 'string' is not assignable to type 'never'.
z = x; // Error
~
!!! error TS2322: Type 'keyof T' is not assignable to type 'NonFunctionPropertyNames'.
@@ -255,7 +267,11 @@ conditionalTypes1.ts(288,43): error TS2322: Type 'T95' is not assignable to t
~
!!! error TS2322: Type 'FunctionPropertyNames' is not assignable to type 'NonFunctionPropertyNames'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
-!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
+!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
+!!! error TS2322: Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
+!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
+!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'never'.
+!!! error TS2322: Type 'string' is not assignable to type 'never'.
}
type DeepReadonly =
diff --git a/tests/baselines/reference/covariantCallbacks.errors.txt b/tests/baselines/reference/covariantCallbacks.errors.txt
index 7a9e34234fc..0df9028e132 100644
--- a/tests/baselines/reference/covariantCallbacks.errors.txt
+++ b/tests/baselines/reference/covariantCallbacks.errors.txt
@@ -1,13 +1,13 @@
covariantCallbacks.ts(12,5): error TS2322: Type 'P' is not assignable to type 'P'.
Property 'b' is missing in type 'A' but required in type 'B'.
covariantCallbacks.ts(17,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'.
- Type 'A' is not assignable to type 'B'.
+ Property 'b' is missing in type 'A' but required in type 'B'.
covariantCallbacks.ts(30,5): error TS2322: Type 'AList1' is not assignable to type 'BList1'.
Types of property 'forEach' are incompatible.
Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: B) => void) => void'.
Types of parameters 'cb' and 'cb' are incompatible.
Types of parameters 'item' and 'item' are incompatible.
- Type 'A' is not assignable to type 'B'.
+ Property 'b' is missing in type 'A' but required in type 'B'.
covariantCallbacks.ts(43,5): error TS2322: Type 'AList2' is not assignable to type 'BList2'.
Types of property 'forEach' are incompatible.
Types of parameters 'cb' and 'cb' are incompatible.
@@ -22,7 +22,7 @@ covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to ty
Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
Types of parameters 'cb' and 'cb' are incompatible.
Types of parameters 'item' and 'item' are incompatible.
- Type 'A' is not assignable to type 'B'.
+ Property 'b' is missing in type 'A' but required in type 'B'.
covariantCallbacks.ts(98,1): error TS2322: Type 'SetLike1<(x: string) => void>' is not assignable to type 'SetLike1<(x: unknown) => void>'.
Type '(x: string) => void' is not assignable to type '(x: unknown) => void'.
Types of parameters 'x' and 'x' are incompatible.
@@ -58,7 +58,8 @@ covariantCallbacks.ts(106,1): error TS2322: Type 'SetLike2<(x: string) => void>'
b = a; // Error
~
!!! error TS2322: Type 'Promise' is not assignable to type 'Promise'.
-!!! error TS2322: Type 'A' is not assignable to type 'B'.
+!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 covariantCallbacks.ts:8:25: 'b' is declared here.
}
interface AList1 {
@@ -78,7 +79,8 @@ covariantCallbacks.ts(106,1): error TS2322: Type 'SetLike2<(x: string) => void>'
!!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: B) => void) => void'.
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
-!!! error TS2322: Type 'A' is not assignable to type 'B'.
+!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 covariantCallbacks.ts:8:25: 'b' is declared here.
}
interface AList2 {
@@ -135,7 +137,8 @@ covariantCallbacks.ts(106,1): error TS2322: Type 'SetLike2<(x: string) => void>'
!!! error TS2322: Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
-!!! error TS2322: Type 'A' is not assignable to type 'B'.
+!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
+!!! related TS2728 covariantCallbacks.ts:8:25: 'b' is declared here.
}
// Repro from #51620
diff --git a/tests/baselines/reference/elaboratedErrors.errors.txt b/tests/baselines/reference/elaboratedErrors.errors.txt
index 4533af3bbeb..509bfa220d6 100644
--- a/tests/baselines/reference/elaboratedErrors.errors.txt
+++ b/tests/baselines/reference/elaboratedErrors.errors.txt
@@ -1,9 +1,9 @@
elaboratedErrors.ts(11,3): error TS2416: Property 'read' in type 'WorkerFS' is not assignable to the same property in base type 'FileSystem'.
Type 'string' is not assignable to type 'number'.
elaboratedErrors.ts(20,1): error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
-elaboratedErrors.ts(21,1): error TS2322: Type 'Beta' is not assignable to type 'Alpha'.
+elaboratedErrors.ts(21,1): error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
elaboratedErrors.ts(24,1): error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
-elaboratedErrors.ts(25,1): error TS2322: Type 'Alpha' is not assignable to type 'Beta'.
+elaboratedErrors.ts(25,1): error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
==== elaboratedErrors.ts (5 errors) ====
@@ -35,7 +35,8 @@ elaboratedErrors.ts(25,1): error TS2322: Type 'Alpha' is not assignable to type
!!! related TS2728 elaboratedErrors.ts:14:19: 'x' is declared here.
x = y;
~
-!!! error TS2322: Type 'Beta' is not assignable to type 'Alpha'.
+!!! error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
+!!! related TS2728 elaboratedErrors.ts:14:19: 'x' is declared here.
// Only one of these errors should be large
y = x;
@@ -44,5 +45,6 @@ elaboratedErrors.ts(25,1): error TS2322: Type 'Alpha' is not assignable to type
!!! related TS2728 elaboratedErrors.ts:15:18: 'y' is declared here.
y = x;
~
-!!! error TS2322: Type 'Alpha' is not assignable to type 'Beta'.
+!!! error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
+!!! related TS2728 elaboratedErrors.ts:15:18: 'y' is declared here.
\ No newline at end of file
diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt
index 4b04c7ac161..c5e9a1bf5f4 100644
--- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt
+++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt
@@ -19,7 +19,7 @@ everyTypeWithAnnotationAndInvalidInitializer.ts(48,32): error TS2322: Type 'stri
everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'.
The types returned by 'new A()' are incompatible between these types.
Property 'name' is missing in type 'N.A' but required in type 'M.A'.
-everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'N.A' is not assignable to type 'M.A'.
+everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2741: Property 'name' is missing in type 'N.A' but required in type 'M.A'.
everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'.
Type 'boolean' is not assignable to type 'string'.
@@ -116,7 +116,8 @@ everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: n
!!! related TS2728 everyTypeWithAnnotationAndInvalidInitializer.ts:20:9: 'name' is declared here.
var aClassInModule: M.A = new N.A();
~~~~~~~~~~~~~~
-!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'.
+!!! error TS2741: Property 'name' is missing in type 'N.A' but required in type 'M.A'.
+!!! related TS2728 everyTypeWithAnnotationAndInvalidInitializer.ts:20:9: 'name' is declared here.
var aFunctionInModule: typeof M.F2 = F2;
~~~~~~~~~~~~~~~~~
!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'.
diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt
index 2bb7f3f550c..d9249711d1d 100644
--- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt
+++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt
@@ -23,6 +23,8 @@ functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is
Type 'void' is not assignable to type 'string'.
functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'.
Type 'T' is not assignable to type '(x: string) => string'.
+ Type '() => void' is not assignable to type '(x: string) => string'.
+ Type 'void' is not assignable to type 'string'.
==== functionConstraintSatisfaction2.ts (13 errors) ====
@@ -102,5 +104,7 @@ functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is
~
!!! error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'T' is not assignable to type '(x: string) => string'.
+!!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'.
+!!! error TS2345: Type 'void' is not assignable to type 'string'.
}
\ No newline at end of file
diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt
index ff1eb4b8888..36e42284cd6 100644
--- a/tests/baselines/reference/fuzzy.errors.txt
+++ b/tests/baselines/reference/fuzzy.errors.txt
@@ -1,7 +1,7 @@
fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'.
Property 'alsoWorks' is missing in type 'C' but required in type 'I'.
fuzzy.ts(21,34): error TS2322: Type 'this' is not assignable to type 'I'.
- Type 'C' is not assignable to type 'I'.
+ Property 'alsoWorks' is missing in type 'C' but required in type 'I'.
fuzzy.ts(25,20): error TS2352: Conversion of type '{ oneI: this; }' to type 'R' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property 'anything' is missing in type '{ oneI: this; }' but required in type 'R'.
@@ -34,7 +34,8 @@ fuzzy.ts(25,20): error TS2352: Conversion of type '{ oneI: this; }' to type 'R'
return { anything:1, oneI:this };
~~~~
!!! error TS2322: Type 'this' is not assignable to type 'I'.
-!!! error TS2322: Type 'C' is not assignable to type 'I'.
+!!! error TS2322: Property 'alsoWorks' is missing in type 'C' but required in type 'I'.
+!!! related TS2728 fuzzy.ts:4:9: 'alsoWorks' is declared here.
!!! related TS6500 fuzzy.ts:10:9: The expected type comes from property 'oneI' which is declared here on type 'R'
}
diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt
index 81470452eb8..4a64dd5471f 100644
--- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt
+++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt
@@ -4,14 +4,20 @@ genericAssignmentCompatWithInterfaces1.ts(12,23): error TS2322: Type 'A'
Types of parameters 'other' and 'other' are incompatible.
Type 'string' is not assignable to type 'number'.
genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'.
- Types of property 'x' are incompatible.
- Type 'A' is not assignable to type 'Comparable'.
+ The types of 'x.compareTo' are incompatible between these types.
+ Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+ Types of parameters 'other' and 'other' are incompatible.
+ Type 'string' is not assignable to type 'number'.
genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'.
- Types of property 'x' are incompatible.
- Type 'A' is not assignable to type 'Comparable'.
+ The types of 'x.compareTo' are incompatible between these types.
+ Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+ Types of parameters 'other' and 'other' are incompatible.
+ Type 'string' is not assignable to type 'number'.
genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I'.
- Types of property 'x' are incompatible.
- Type 'A' is not assignable to type 'Comparable'.
+ The types of 'x.compareTo' are incompatible between these types.
+ Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+ Types of parameters 'other' and 'other' are incompatible.
+ Type 'string' is not assignable to type 'number'.
==== genericAssignmentCompatWithInterfaces1.ts (4 errors) ====
@@ -37,19 +43,25 @@ genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K'
var a2: I = function (): { x: A } {
~~
!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'.
-!!! error TS2322: Types of property 'x' are incompatible.
-!!! error TS2322: Type 'A' is not assignable to type 'Comparable'.
+!!! error TS2322: The types of 'x.compareTo' are incompatible between these types.
+!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+!!! error TS2322: Types of parameters 'other' and 'other' are incompatible.
+!!! error TS2322: Type 'string' is not assignable to type 'number'.
var z = { x: new A() }; return z;
} ();
var a3: I = z;
~~
!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'.
-!!! error TS2322: Types of property 'x' are incompatible.
-!!! error TS2322: Type 'A' is not assignable to type 'Comparable'.
+!!! error TS2322: The types of 'x.compareTo' are incompatible between these types.
+!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+!!! error TS2322: Types of parameters 'other' and 'other' are incompatible.
+!!! error TS2322: Type 'string' is not assignable to type 'number'.
var a4: I = >z;
~~
!!! error TS2322: Type 'K' is not assignable to type 'I'.
-!!! error TS2322: Types of property 'x' are incompatible.
-!!! error TS2322: Type 'A' is not assignable to type 'Comparable'.
+!!! error TS2322: The types of 'x.compareTo' are incompatible between these types.
+!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'.
+!!! error TS2322: Types of parameters 'other' and 'other' are incompatible.
+!!! error TS2322: Type 'string' is not assignable to type 'number'.
\ No newline at end of file
diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt
index 42fe31432f2..653b071b3b4 100644
--- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt
+++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt
@@ -9,6 +9,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No
Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
Type 'Promise' is not assignable to type 'Promise'.
+ Type 'number' is not assignable to type 'string'.
genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No overload matches this call.
Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
@@ -17,9 +18,11 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No
Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
Type 'Promise' is not assignable to type 'Promise'.
+ Type 'number' is not assignable to type 'string'.
Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
Type 'Promise' is not assignable to type 'Promise'.
+ Type 'number' is not assignable to type 'string'.
genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No overload matches this call.
Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
@@ -28,6 +31,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No
Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error.
Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
Type 'Promise' is not assignable to type 'Promise'.
+ Type 'number' is not assignable to type 'boolean'.
==== genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ====
@@ -96,6 +100,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No
!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error.
!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'.
+!!! error TS2769: Type 'number' is not assignable to type 'string'.
}
//////////////////////////////////////
@@ -121,9 +126,11 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No
!!! error TS2769: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error.
!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'.
!!! error TS2769: Type 'Promise