mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make type comparison error elaboration consistent (#58859)
This commit is contained in:
1 parent
6d3be985c8
commit
03143729b1
84 files changed
+1183
-246
No files matched your search
+18
-20
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
@@ -3,7 +3,7 @@ arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is
|
||||
arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C<A>' 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<A>' is
|
||||
!!! error TS2322: Type 'C<A>' 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.
|
||||
|
||||
@@ -11,7 +11,7 @@ assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]:
|
||||
assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A<T>' 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<T>'.
|
||||
'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<T>' 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<T>' is not as
|
||||
!!! error TS2322: Type 'A<T>' 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<T>' is not as
|
||||
!!! error TS2322: Type 'A<T>' 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
|
||||
|
||||
@@ -11,7 +11,7 @@ assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]:
|
||||
assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A<T>' 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<T>'.
|
||||
'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<T>' 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<T>' is not a
|
||||
!!! error TS2322: Type 'A<T>' 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<T>' is not a
|
||||
!!! error TS2322: Type 'A<T>' 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'.
|
||||
|
||||
@@ -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<Base>' 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<Base>' 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<T>'.
|
||||
'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<T>' 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<T>'.
|
||||
'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<T>' 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<T>' is not ass
|
||||
~~
|
||||
!!! error TS2322: Type 'A<Base>' 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<Base> {
|
||||
[x: string]: Derived2; // ok
|
||||
@@ -86,7 +87,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
|
||||
~~
|
||||
!!! error TS2322: Type 'A<Base>' 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<T extends Base>() {
|
||||
var b3: { [x: string]: Derived; };
|
||||
@@ -102,7 +103,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
|
||||
!!! error TS2322: Type 'A<T>' 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<T>' is not ass
|
||||
!!! error TS2322: Type 'A<T>' 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
|
||||
}
|
||||
}
|
||||
@@ -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<Base>' 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<Base>' 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<T>'.
|
||||
'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<T>' 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<T>'.
|
||||
'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<T>' 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<T>' is not as
|
||||
~~
|
||||
!!! error TS2322: Type 'A<Base>' 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<Base> {
|
||||
[x: string]: Derived2; // ok
|
||||
@@ -86,7 +87,7 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not as
|
||||
~~
|
||||
!!! error TS2322: Type 'A<Base>' 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<T extends Base>() {
|
||||
var b3: { [x: string]: Derived; };
|
||||
@@ -102,7 +103,8 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not as
|
||||
!!! error TS2322: Type 'A<T>' 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<T>' is not as
|
||||
!!! error TS2322: Type 'A<T>' 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
|
||||
}
|
||||
}
|
||||
+3
@@ -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'.
|
||||
|
||||
+3
@@ -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'.
|
||||
|
||||
@@ -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<bigint>): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
Type 'IteratorResult<number, any>' is not assignable to type 'IteratorResult<bigint, any>'.
|
||||
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<bigint, any>'.
|
||||
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<bigint>'.
|
||||
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<bigint>): BigUint64Array', gave the following error.
|
||||
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
!!! error TS2769: Type 'IteratorResult<number, any>' is not assignable to type 'IteratorResult<bigint, any>'.
|
||||
!!! error TS2769: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<bigint, any>'.
|
||||
!!! error TS2769: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<bigint>'.
|
||||
!!! 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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'.
|
||||
!!! error TS2739: Type 'Z' is missing the following properties from type 'Y': a, b
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
@@ -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<ResizablePanelProps>'.
|
||||
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<ResizablePanelProps>'.
|
||||
!!! 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.
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
|
||||
+6
@@ -7,6 +7,9 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
|
||||
|
||||
==== circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ====
|
||||
@@ -83,4 +86,7 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
|
||||
@@ -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";
|
||||
|
||||
+28
-18
@@ -5,18 +5,23 @@ complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts(33,5): error TS2322
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["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<T, TextChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["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<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["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<T, TextChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'ChannelOfType<T, TextChannel>["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');
|
||||
|
||||
@@ -37,20 +37,28 @@ conditionalTypes1.ts(108,5): error TS2322: Type 'FunctionProperties<T>' 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<T>'.
|
||||
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<T>' is not assignable to type 'FunctionPropertyNames<T>'.
|
||||
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<T>'.
|
||||
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<T>' is not assignable to type 'NonFunctionPropertyNames<T>'.
|
||||
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<Part>' 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<U>' 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<T>(x: keyof T, y: FunctionPropertyNames<T>, z: NonFunctionPropertyNames<T>) {
|
||||
@@ -243,9 +253,11 @@ conditionalTypes1.ts(288,43): error TS2322: Type 'T95<U>' is not assignable to t
|
||||
~
|
||||
!!! error TS2322: Type 'NonFunctionPropertyNames<T>' is not assignable to type 'FunctionPropertyNames<T>'.
|
||||
!!! 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<T>'.
|
||||
@@ -255,7 +267,11 @@ conditionalTypes1.ts(288,43): error TS2322: Type 'T95<U>' is not assignable to t
|
||||
~
|
||||
!!! error TS2322: Type 'FunctionPropertyNames<T>' is not assignable to type 'NonFunctionPropertyNames<T>'.
|
||||
!!! 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<T> =
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
covariantCallbacks.ts(12,5): error TS2322: Type 'P<A>' is not assignable to type 'P<B>'.
|
||||
Property 'b' is missing in type 'A' but required in type 'B'.
|
||||
covariantCallbacks.ts(17,5): error TS2322: Type 'Promise<A>' is not assignable to type 'Promise<B>'.
|
||||
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<A>' is not assignable to type 'Promise<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 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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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'.
|
||||
|
||||
@@ -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'.
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,20 @@ genericAssignmentCompatWithInterfaces1.ts(12,23): error TS2322: Type 'A<number>'
|
||||
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<number>; }' is not assignable to type 'I<string>'.
|
||||
Types of property 'x' are incompatible.
|
||||
Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
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<number>; }' is not assignable to type 'I<string>'.
|
||||
Types of property 'x' are incompatible.
|
||||
Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
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<number>' is not assignable to type 'I<string>'.
|
||||
Types of property 'x' are incompatible.
|
||||
Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
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<number>'
|
||||
var a2: I<string> = function (): { x: A<number> } {
|
||||
~~
|
||||
!!! error TS2322: Type '{ x: A<number>; }' is not assignable to type 'I<string>'.
|
||||
!!! error TS2322: Types of property 'x' are incompatible.
|
||||
!!! error TS2322: Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
!!! 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<number>() }; return z;
|
||||
} ();
|
||||
var a3: I<string> = z;
|
||||
~~
|
||||
!!! error TS2322: Type '{ x: A<number>; }' is not assignable to type 'I<string>'.
|
||||
!!! error TS2322: Types of property 'x' are incompatible.
|
||||
!!! error TS2322: Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
!!! 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<string> = <K<number>>z;
|
||||
~~
|
||||
!!! error TS2322: Type 'K<number>' is not assignable to type 'I<string>'.
|
||||
!!! error TS2322: Types of property 'x' are incompatible.
|
||||
!!! error TS2322: Type 'A<number>' is not assignable to type 'Comparable<string>'.
|
||||
!!! 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'.
|
||||
|
||||
|
||||
+8
@@ -9,6 +9,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No
|
||||
Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
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<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
@@ -17,9 +18,11 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No
|
||||
Overload 2 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
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<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
@@ -28,6 +31,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No
|
||||
Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
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<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2769: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! 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<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2769: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2769: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2769: Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2769: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2769: Type 'number' is not assignable to type 'string'.
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
@@ -149,5 +156,6 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No
|
||||
!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
!!! error TS2769: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
!!! error TS2769: Type 'number' is not assignable to type 'boolean'.
|
||||
}
|
||||
|
||||
+3
-2
@@ -4,7 +4,7 @@ genericConditionalConstrainedToUnknownNotAssignableToConcreteObject.ts(13,5): er
|
||||
Type 'ReturnType<T[string]> | ReturnType<T[number]> | ReturnType<T[symbol]>' is not assignable to type 'A'.
|
||||
Type 'ReturnType<T[string]>' is not assignable to type 'A'.
|
||||
Type 'ReturnType<FunctionsObj<T>[string]>' is not assignable to type 'A'.
|
||||
Type 'unknown' is not assignable to type 'A'.
|
||||
Property 'x' is missing in type '{}' but required in type 'A'.
|
||||
|
||||
|
||||
==== genericConditionalConstrainedToUnknownNotAssignableToConcreteObject.ts (1 errors) ====
|
||||
@@ -28,7 +28,8 @@ genericConditionalConstrainedToUnknownNotAssignableToConcreteObject.ts(13,5): er
|
||||
!!! error TS2322: Type 'ReturnType<T[string]> | ReturnType<T[number]> | ReturnType<T[symbol]>' is not assignable to type 'A'.
|
||||
!!! error TS2322: Type 'ReturnType<T[string]>' is not assignable to type 'A'.
|
||||
!!! error TS2322: Type 'ReturnType<FunctionsObj<T>[string]>' is not assignable to type 'A'.
|
||||
!!! error TS2322: Type 'unknown' is not assignable to type 'A'.
|
||||
!!! error TS2322: Property 'x' is missing in type '{}' but required in type 'A'.
|
||||
!!! related TS2728 genericConditionalConstrainedToUnknownNotAssignableToConcreteObject.ts:1:15: 'x' is declared here.
|
||||
}
|
||||
|
||||
// Original CFA report of the above issue
|
||||
|
||||
@@ -2,7 +2,11 @@ inferTypePredicates.ts(4,7): error TS2322: Type '(number | null)[]' is not assig
|
||||
Type 'number | null' is not assignable to type 'number'.
|
||||
Type 'null' is not assignable to type 'number'.
|
||||
inferTypePredicates.ts(7,7): error TS2322: Type '(number | null)[]' is not assignable to type 'number[]'.
|
||||
Type 'number | null' is not assignable to type 'number'.
|
||||
Type 'null' is not assignable to type 'number'.
|
||||
inferTypePredicates.ts(14,7): error TS2322: Type '(number | null)[]' is not assignable to type 'number[]'.
|
||||
Type 'number | null' is not assignable to type 'number'.
|
||||
Type 'null' is not assignable to type 'number'.
|
||||
inferTypePredicates.ts(52,17): error TS18048: 'arr' is possibly 'undefined'.
|
||||
inferTypePredicates.ts(54,28): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
|
||||
Type 'undefined' is not assignable to type 'string'.
|
||||
@@ -31,6 +35,8 @@ inferTypePredicates.ts(205,7): error TS2741: Property 'z' is missing in type 'C1
|
||||
const evenSquaresInline: number[] = // should error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(number | null)[]' is not assignable to type 'number[]'.
|
||||
!!! error TS2322: Type 'number | null' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type 'null' is not assignable to type 'number'.
|
||||
[1, 2, 3, 4]
|
||||
.map(x => x % 2 === 0 ? x * x : null)
|
||||
.filter(x => !!x); // tests truthiness, not non-nullishness
|
||||
@@ -40,6 +46,8 @@ inferTypePredicates.ts(205,7): error TS2741: Property 'z' is missing in type 'C1
|
||||
const evenSquares: number[] = // should error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(number | null)[]' is not assignable to type 'number[]'.
|
||||
!!! error TS2322: Type 'number | null' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type 'null' is not assignable to type 'number'.
|
||||
[1, 2, 3, 4]
|
||||
.map(x => x % 2 === 0 ? x * x : null)
|
||||
.filter(isTruthy);
|
||||
|
||||
@@ -5,7 +5,7 @@ inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements in
|
||||
inheritance1.ts(31,1): error TS2741: Property 'select' is missing in type 'Control' but required in type 'Button'.
|
||||
inheritance1.ts(37,1): error TS2741: Property 'select' is missing in type 'Control' but required in type 'TextBox'.
|
||||
inheritance1.ts(40,1): error TS2741: Property 'select' is missing in type 'Control' but required in type 'SelectableControl'.
|
||||
inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
|
||||
inheritance1.ts(46,1): error TS2741: Property 'select' is missing in type 'Control' but required in type 'SelectableControl'.
|
||||
inheritance1.ts(52,1): error TS2741: Property 'state' is missing in type 'Locations' but required in type 'SelectableControl'.
|
||||
inheritance1.ts(53,1): error TS2741: Property 'state' is missing in type 'Locations' but required in type 'Control'.
|
||||
inheritance1.ts(55,1): error TS2741: Property 'select' is missing in type 'Control' but required in type 'Locations'.
|
||||
@@ -79,7 +79,8 @@ inheritance1.ts(61,1): error TS2741: Property 'select' is missing in type 'Contr
|
||||
var i1: Image1;
|
||||
sc = i1;
|
||||
~~
|
||||
!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
|
||||
!!! error TS2741: Property 'select' is missing in type 'Control' but required in type 'SelectableControl'.
|
||||
!!! related TS2728 inheritance1.ts:5:5: 'select' is declared here.
|
||||
c = i1;
|
||||
i1 = sc;
|
||||
i1 = c;
|
||||
|
||||
@@ -4,15 +4,16 @@ index.tsx(5,1): error TS2741: Property '__predomBrand' is missing in type 'impor
|
||||
index.tsx(21,22): error TS2786: 'MySFC' cannot be used as a JSX component.
|
||||
Its return type 'import("renderer2").predom.JSX.Element' is not a valid JSX element.
|
||||
Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
index.tsx(21,40): error TS2322: Type 'import("renderer").dom.JSX.Element' is not assignable to type 'import("renderer2").predom.JSX.Element'.
|
||||
index.tsx(21,40): error TS2741: Property '__predomBrand' is missing in type 'import("renderer").dom.JSX.Element' but required in type 'import("renderer2").predom.JSX.Element'.
|
||||
index.tsx(21,41): error TS2786: 'MyClass' cannot be used as a JSX component.
|
||||
Its instance type 'MyClass' is not a valid JSX element.
|
||||
Property '__domBrand' is missing in type 'MyClass' but required in type 'ElementClass'.
|
||||
index.tsx(21,63): error TS2322: Type 'import("renderer").dom.JSX.Element' is not assignable to type 'import("renderer2").predom.JSX.Element'.
|
||||
index.tsx(21,63): error TS2741: Property '__predomBrand' is missing in type 'import("renderer").dom.JSX.Element' but required in type 'import("renderer2").predom.JSX.Element'.
|
||||
index.tsx(21,64): error TS2786: 'MyClass' cannot be used as a JSX component.
|
||||
Its instance type 'MyClass' is not a valid JSX element.
|
||||
index.tsx(24,42): error TS2322: Type 'import("renderer2").predom.JSX.Element' is not assignable to type 'import("renderer").dom.JSX.Element'.
|
||||
index.tsx(24,48): error TS2322: Type 'import("renderer2").predom.JSX.Element' is not assignable to type 'import("renderer").dom.JSX.Element'.
|
||||
Property '__domBrand' is missing in type 'MyClass' but required in type 'ElementClass'.
|
||||
index.tsx(24,42): error TS2741: Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
index.tsx(24,48): error TS2741: Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
|
||||
|
||||
==== renderer.d.ts (0 errors) ====
|
||||
@@ -110,22 +111,28 @@ index.tsx(24,48): error TS2322: Type 'import("renderer2").predom.JSX.Element' is
|
||||
!!! error TS2786: Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
!!! related TS2728 renderer.d.ts:7:13: '__domBrand' is declared here.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'import("renderer").dom.JSX.Element' is not assignable to type 'import("renderer2").predom.JSX.Element'.
|
||||
!!! error TS2741: Property '__predomBrand' is missing in type 'import("renderer").dom.JSX.Element' but required in type 'import("renderer2").predom.JSX.Element'.
|
||||
!!! related TS2728 renderer2.d.ts:7:13: '__predomBrand' is declared here.
|
||||
~~~~~~~
|
||||
!!! error TS2786: 'MyClass' cannot be used as a JSX component.
|
||||
!!! error TS2786: Its instance type 'MyClass' is not a valid JSX element.
|
||||
!!! error TS2786: Property '__domBrand' is missing in type 'MyClass' but required in type 'ElementClass'.
|
||||
!!! related TS2728 renderer.d.ts:7:13: '__domBrand' is declared here.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'import("renderer").dom.JSX.Element' is not assignable to type 'import("renderer2").predom.JSX.Element'.
|
||||
!!! error TS2741: Property '__predomBrand' is missing in type 'import("renderer").dom.JSX.Element' but required in type 'import("renderer2").predom.JSX.Element'.
|
||||
!!! related TS2728 renderer2.d.ts:7:13: '__predomBrand' is declared here.
|
||||
~~~~~~~
|
||||
!!! error TS2786: 'MyClass' cannot be used as a JSX component.
|
||||
!!! error TS2786: Its instance type 'MyClass' is not a valid JSX element.
|
||||
!!! error TS2786: Property '__domBrand' is missing in type 'MyClass' but required in type 'ElementClass'.
|
||||
!!! related TS2728 renderer.d.ts:7:13: '__domBrand' is declared here.
|
||||
|
||||
// Should fail, nondom isn't allowed as children of dom
|
||||
const _brokenTree2 = <DOMSFC x={1} y={2}>{tree}{tree}</DOMSFC>
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'import("renderer2").predom.JSX.Element' is not assignable to type 'import("renderer").dom.JSX.Element'.
|
||||
!!! error TS2741: Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
!!! related TS2728 renderer.d.ts:7:13: '__domBrand' is declared here.
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'import("renderer2").predom.JSX.Element' is not assignable to type 'import("renderer").dom.JSX.Element'.
|
||||
!!! error TS2741: Property '__domBrand' is missing in type 'import("renderer2").predom.JSX.Element' but required in type 'import("renderer").dom.JSX.Element'.
|
||||
!!! related TS2728 renderer.d.ts:7:13: '__domBrand' is declared here.
|
||||
|
||||
@@ -2,9 +2,9 @@ interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrench
|
||||
Types of parameters 'a' and 'a' are incompatible.
|
||||
Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'.
|
||||
interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'.
|
||||
interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'.
|
||||
interfaceAssignmentCompat.ts(42,13): error TS2741: Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'.
|
||||
interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'.
|
||||
Type 'IEye' is not assignable to type 'IFrenchEye'.
|
||||
Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'.
|
||||
|
||||
|
||||
==== interfaceAssignmentCompat.ts (4 errors) ====
|
||||
@@ -58,12 +58,14 @@ interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignabl
|
||||
for (var j=z.length=1;j>=0;j--) {
|
||||
eeks[j]=z[j]; // nope: element assignment
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'.
|
||||
!!! error TS2741: Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'.
|
||||
!!! related TS2728 interfaceAssignmentCompat.ts:13:9: 'coleur' is declared here.
|
||||
}
|
||||
eeks=z; // nope: array assignment
|
||||
~~~~
|
||||
!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'.
|
||||
!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'.
|
||||
!!! error TS2322: Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'.
|
||||
!!! related TS2728 interfaceAssignmentCompat.ts:13:9: 'coleur' is declared here.
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ intersectionAndUnionTypes.ts(20,1): error TS2322: Type 'B' is not assignable to
|
||||
intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'.
|
||||
Type 'A' is not assignable to type '(A & B) | (C & D)'.
|
||||
Type 'A' is not assignable to type 'A & B'.
|
||||
Property 'b' is missing in type 'A' but required in type 'B'.
|
||||
intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'.
|
||||
Type 'C' is not assignable to type '(A & B) | (C & D)'.
|
||||
Type 'C' is not assignable to type 'C & D'.
|
||||
@@ -77,6 +78,8 @@ intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A | B) & (C | D)' is no
|
||||
!!! error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'A & B'.
|
||||
!!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'.
|
||||
!!! related TS2728 intersectionAndUnionTypes.ts:2:15: 'b' is declared here.
|
||||
x = cnd; // Ok
|
||||
x = cod;
|
||||
~
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
invariantGenericErrorElaboration.ts(3,7): error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
|
||||
The types of 'constraint.constraint' are incompatible between these types.
|
||||
Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
|
||||
Type 'Runtype<any>' is not assignable to type 'Num'.
|
||||
Property 'tag' is missing in type 'Runtype<any>' but required in type 'Num'.
|
||||
invariantGenericErrorElaboration.ts(4,19): error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
|
||||
The types of 'constraint.constraint' are incompatible between these types.
|
||||
Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
|
||||
Property 'tag' is missing in type 'Runtype<any>' but required in type 'Num'.
|
||||
|
||||
|
||||
==== invariantGenericErrorElaboration.ts (2 errors) ====
|
||||
@@ -13,10 +16,13 @@ invariantGenericErrorElaboration.ts(4,19): error TS2322: Type 'Num' is not assig
|
||||
!!! error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
|
||||
!!! error TS2322: The types of 'constraint.constraint' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
|
||||
!!! error TS2322: Type 'Runtype<any>' is not assignable to type 'Num'.
|
||||
!!! error TS2322: Property 'tag' is missing in type 'Runtype<any>' but required in type 'Num'.
|
||||
const Foo = Obj({ foo: Num })
|
||||
~~~
|
||||
!!! error TS2322: Type 'Num' is not assignable to type 'Runtype<any>'.
|
||||
!!! error TS2322: The types of 'constraint.constraint' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Constraint<Constraint<Num>>' is not assignable to type 'Constraint<Constraint<Runtype<any>>>'.
|
||||
!!! error TS2322: Property 'tag' is missing in type 'Runtype<any>' but required in type 'Num'.
|
||||
!!! related TS6501 invariantGenericErrorElaboration.ts:17:34: The expected type comes from this index signature.
|
||||
|
||||
interface Runtype<A> {
|
||||
|
||||
@@ -7,6 +7,9 @@ iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
|
||||
Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
||||
The types returned by 'slice(...)' are incompatible between these types.
|
||||
Type 'symbol[]' is not assignable to type 'number[]'.
|
||||
Type 'symbol' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== iteratorSpreadInArray6.ts (1 errors) ====
|
||||
@@ -34,4 +37,7 @@ iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Type 'symbol' is not assignable to type 'number'.
|
||||
!!! error TS2769: Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
|
||||
!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
|
||||
!!! error TS2769: Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
||||
!!! error TS2769: Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
||||
!!! error TS2769: The types returned by 'slice(...)' are incompatible between these types.
|
||||
!!! error TS2769: Type 'symbol[]' is not assignable to type 'number[]'.
|
||||
!!! error TS2769: Type 'symbol' is not assignable to type 'number'.
|
||||
@@ -10,6 +10,9 @@ jsxComponentTypeErrors.tsx(25,16): error TS2786: 'FunctionComponent' cannot be u
|
||||
Type 'undefined' is not assignable to type '"element"'.
|
||||
jsxComponentTypeErrors.tsx(26,16): error TS2786: 'FunctionComponent' cannot be used as a JSX component.
|
||||
Its return type '{ type: "abc" | undefined; }' is not a valid JSX element.
|
||||
Types of property 'type' are incompatible.
|
||||
Type '"abc" | undefined' is not assignable to type '"element"'.
|
||||
Type 'undefined' is not assignable to type '"element"'.
|
||||
jsxComponentTypeErrors.tsx(27,16): error TS2786: 'ClassComponent' cannot be used as a JSX component.
|
||||
Its instance type 'ClassComponent' is not a valid JSX element.
|
||||
Types of property 'type' are incompatible.
|
||||
@@ -19,6 +22,8 @@ jsxComponentTypeErrors.tsx(28,16): error TS2786: 'MixedComponent' cannot be used
|
||||
Type 'ClassComponent' is not assignable to type 'Element | ElementClass | null'.
|
||||
Type 'ClassComponent' is not assignable to type 'Element | ElementClass'.
|
||||
Type 'ClassComponent' is not assignable to type 'ElementClass'.
|
||||
Types of property 'type' are incompatible.
|
||||
Type 'string' is not assignable to type '"element-class"'.
|
||||
jsxComponentTypeErrors.tsx(37,16): error TS2786: 'obj.MemberFunctionComponent' cannot be used as a JSX component.
|
||||
Its return type '{}' is not a valid JSX element.
|
||||
Property 'type' is missing in type '{}' but required in type 'Element'.
|
||||
@@ -69,6 +74,9 @@ jsxComponentTypeErrors.tsx(38,16): error TS2786: 'obj. MemberClassComponent' can
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2786: 'FunctionComponent' cannot be used as a JSX component.
|
||||
!!! error TS2786: Its return type '{ type: "abc" | undefined; }' is not a valid JSX element.
|
||||
!!! error TS2786: Types of property 'type' are incompatible.
|
||||
!!! error TS2786: Type '"abc" | undefined' is not assignable to type '"element"'.
|
||||
!!! error TS2786: Type 'undefined' is not assignable to type '"element"'.
|
||||
const elem3 = <ClassComponent />;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2786: 'ClassComponent' cannot be used as a JSX component.
|
||||
@@ -82,6 +90,8 @@ jsxComponentTypeErrors.tsx(38,16): error TS2786: 'obj. MemberClassComponent' can
|
||||
!!! error TS2786: Type 'ClassComponent' is not assignable to type 'Element | ElementClass | null'.
|
||||
!!! error TS2786: Type 'ClassComponent' is not assignable to type 'Element | ElementClass'.
|
||||
!!! error TS2786: Type 'ClassComponent' is not assignable to type 'ElementClass'.
|
||||
!!! error TS2786: Types of property 'type' are incompatible.
|
||||
!!! error TS2786: Type 'string' is not assignable to type '"element-class"'.
|
||||
|
||||
const obj = {
|
||||
MemberFunctionComponent() {
|
||||
|
||||
@@ -11,6 +11,8 @@ keyofAndIndexedAccess.ts(317,5): error TS2322: Type 'T[keyof T]' is not assignab
|
||||
Type 'T[string]' is not assignable to type '{}'.
|
||||
keyofAndIndexedAccess.ts(318,5): error TS2322: Type 'T[K]' is not assignable to type '{}'.
|
||||
Type 'T[keyof T]' is not assignable to type '{}'.
|
||||
Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{}'.
|
||||
Type 'T[string]' is not assignable to type '{}'.
|
||||
|
||||
|
||||
==== keyofAndIndexedAccess.ts (5 errors) ====
|
||||
@@ -351,6 +353,8 @@ keyofAndIndexedAccess.ts(318,5): error TS2322: Type 'T[K]' is not assignable to
|
||||
~
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type '{}'.
|
||||
!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{}'.
|
||||
!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{}'.
|
||||
!!! error TS2322: Type 'T[string]' is not assignable to type '{}'.
|
||||
}
|
||||
|
||||
function f92<T, K extends keyof T>(x: T, y: T[keyof T], z: T[K]) {
|
||||
|
||||
@@ -22,6 +22,7 @@ keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" |
|
||||
Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
keyofAndIndexedAccessErrors.ts(73,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'.
|
||||
keyofAndIndexedAccessErrors.ts(74,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'.
|
||||
keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
@@ -34,10 +35,28 @@ keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is
|
||||
Type 'string' is not assignable to type 'keyof U'.
|
||||
keyofAndIndexedAccessErrors.ts(83,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T'.
|
||||
Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof U'.
|
||||
keyofAndIndexedAccessErrors.ts(86,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T'.
|
||||
Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof U'.
|
||||
keyofAndIndexedAccessErrors.ts(87,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof T'.
|
||||
Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
Type 'string' is not assignable to type 'keyof U'.
|
||||
keyofAndIndexedAccessErrors.ts(103,9): error TS2322: Type 'Extract<keyof T, string>' is not assignable to type 'K'.
|
||||
'Extract<keyof T, string>' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
Type 'string' is not assignable to type 'K'.
|
||||
@@ -45,6 +64,8 @@ keyofAndIndexedAccessErrors.ts(103,9): error TS2322: Type 'Extract<keyof T, stri
|
||||
keyofAndIndexedAccessErrors.ts(105,9): error TS2322: Type 'T[Extract<keyof T, string>]' is not assignable to type 'T[K]'.
|
||||
Type 'Extract<keyof T, string>' is not assignable to type 'K'.
|
||||
'Extract<keyof T, string>' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
Type 'string' is not assignable to type 'K'.
|
||||
'string' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
keyofAndIndexedAccessErrors.ts(108,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
@@ -184,6 +205,7 @@ keyofAndIndexedAccessErrors.ts(165,5): error TS2322: Type 'number' is not assign
|
||||
setProperty(shape, cond ? "name" : "size", 10); // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
}
|
||||
|
||||
function f20<T, U>(x: T | U, y: T & U, k1: keyof (T | U), k2: keyof T & keyof U, k3: keyof (T & U), k4: keyof T | keyof U) {
|
||||
@@ -216,16 +238,34 @@ keyofAndIndexedAccessErrors.ts(165,5): error TS2322: Type 'number' is not assign
|
||||
~~
|
||||
!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof U'.
|
||||
|
||||
k2 = k1;
|
||||
k2 = k3; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof U'.
|
||||
k2 = k4; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T & keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof T'.
|
||||
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof U'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof U'.
|
||||
|
||||
k3 = k1;
|
||||
k3 = k2;
|
||||
@@ -253,6 +293,8 @@ keyofAndIndexedAccessErrors.ts(165,5): error TS2322: Type 'number' is not assign
|
||||
!!! error TS2322: Type 'T[Extract<keyof T, string>]' is not assignable to type 'T[K]'.
|
||||
!!! error TS2322: Type 'Extract<keyof T, string>' is not assignable to type 'K'.
|
||||
!!! error TS2322: 'Extract<keyof T, string>' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'K'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
}
|
||||
tk = uk;
|
||||
uk = tk; // error
|
||||
|
||||
@@ -3,6 +3,8 @@ lastPropertyInLiteralWins.ts(8,5): error TS2322: Type '(num: number) => void' is
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
lastPropertyInLiteralWins.ts(9,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
||||
lastPropertyInLiteralWins.ts(9,5): error TS2322: Type '(num: number) => void' is not assignable to type '(str: string) => void'.
|
||||
Types of parameters 'num' and 'str' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
lastPropertyInLiteralWins.ts(14,5): error TS1117: An object literal cannot have multiple properties with the same name.
|
||||
|
||||
|
||||
@@ -25,6 +27,8 @@ lastPropertyInLiteralWins.ts(14,5): error TS1117: An object literal cannot have
|
||||
!!! error TS1117: An object literal cannot have multiple properties with the same name.
|
||||
~~~~~
|
||||
!!! error TS2322: Type '(num: number) => void' is not assignable to type '(str: string) => void'.
|
||||
!!! error TS2322: Types of parameters 'num' and 'str' are incompatible.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS6500 lastPropertyInLiteralWins.ts:2:5: The expected type comes from property 'thunk' which is declared here on type 'Thing'
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mappedTypeWithAny.ts(23,16): error TS2339: Property 'notAValue' does not exist on type 'Data'.
|
||||
mappedTypeWithAny.ts(45,5): error TS2740: Type 'Objectish<any>' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more.
|
||||
mappedTypeWithAny.ts(46,5): error TS2322: Type 'Objectish<any>' is not assignable to type 'any[]'.
|
||||
mappedTypeWithAny.ts(46,5): error TS2740: Type 'Objectish<any>' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more.
|
||||
mappedTypeWithAny.ts(53,5): error TS2322: Type 'string[]' is not assignable to type '[any, any]'.
|
||||
Target requires 2 element(s) but source may have fewer.
|
||||
|
||||
@@ -57,7 +57,7 @@ mappedTypeWithAny.ts(53,5): error TS2322: Type 'string[]' is not assignable to t
|
||||
!!! error TS2740: Type 'Objectish<any>' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more.
|
||||
arr = indirectArrayish;
|
||||
~~~
|
||||
!!! error TS2322: Type 'Objectish<any>' is not assignable to type 'any[]'.
|
||||
!!! error TS2740: Type 'Objectish<any>' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more.
|
||||
}
|
||||
|
||||
declare function stringifyArray<T extends readonly any[]>(arr: T): { -readonly [K in keyof T]: string };
|
||||
|
||||
@@ -3,29 +3,49 @@ noUncheckedIndexedAccess.ts(3,32): error TS2344: Type 'boolean | undefined' does
|
||||
noUncheckedIndexedAccess.ts(12,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(13,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(14,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(15,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(16,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(17,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(18,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(19,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(20,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(21,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(22,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(23,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(24,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(25,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(38,1): error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(39,1): error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(40,1): error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(41,1): error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(46,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(47,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(48,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(49,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(50,7): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(55,5): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(63,5): error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
Type 'undefined' is not assignable to type 'boolean'.
|
||||
noUncheckedIndexedAccess.ts(79,7): error TS2322: Type 'number | boolean | undefined' is not assignable to type 'number | boolean'.
|
||||
Type 'undefined' is not assignable to type 'number | boolean'.
|
||||
noUncheckedIndexedAccess.ts(85,1): error TS2322: Type 'undefined' is not assignable to type 'string'.
|
||||
@@ -58,42 +78,55 @@ noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'undefined' is not assign
|
||||
const e2: boolean = strMap.bar;
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e3: boolean = strMap[0];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e4: boolean = strMap[0 as string | number];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e5: boolean = strMap[0 as string | 0 | 1];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e6: boolean = strMap[0 as 0 | 1];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e7: boolean = strMap["foo" as "foo" | "baz"];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e8: boolean = strMap[NumericEnum1.A];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e9: boolean = strMap[NumericEnum2.A];
|
||||
~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e10: boolean = strMap[StringEnum1.A];
|
||||
~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e11: boolean = strMap[StringEnum1.A as StringEnum1];
|
||||
~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e12: boolean = strMap[NumericEnum1.A as NumericEnum1];
|
||||
~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e13: boolean = strMap[NumericEnum2.A as NumericEnum2];
|
||||
~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const e14: boolean = strMap[null as any];
|
||||
~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
|
||||
// Should be OK
|
||||
const ok1: boolean | undefined = strMap["foo"];
|
||||
@@ -125,18 +158,23 @@ noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'undefined' is not assign
|
||||
const num_ok1: boolean = numMap[0];
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const num_ok2: boolean = numMap[0 as number];
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const num_ok3: boolean = numMap[0 as 0 | 1];
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const num_ok4: boolean = numMap[NumericEnum1.A];
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
const num_ok5: boolean = numMap[NumericEnum2.A];
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
|
||||
// Generics
|
||||
function generic1<T extends { [s: string]: boolean }>(arg: T): boolean {
|
||||
@@ -144,6 +182,7 @@ noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'undefined' is not assign
|
||||
return arg["blah"];
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
}
|
||||
function generic2<T extends { [s: string]: boolean }>(arg: T): boolean {
|
||||
// Should OK
|
||||
@@ -154,6 +193,7 @@ noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'undefined' is not assign
|
||||
return strMap[arg];
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'boolean | undefined' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'.
|
||||
}
|
||||
|
||||
// Element access into known properties is ok
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
objectLiteralIndexerErrors.ts(13,54): error TS2741: Property 'y' is missing in type 'A' but required in type 'B'.
|
||||
objectLiteralIndexerErrors.ts(14,14): error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
objectLiteralIndexerErrors.ts(14,14): error TS2741: Property 'y' is missing in type 'A' but required in type 'B'.
|
||||
|
||||
|
||||
==== objectLiteralIndexerErrors.ts (2 errors) ====
|
||||
@@ -22,5 +22,6 @@ objectLiteralIndexerErrors.ts(14,14): error TS2322: Type 'A' is not assignable t
|
||||
!!! related TS6501 objectLiteralIndexerErrors.ts:13:26: The expected type comes from this index signature.
|
||||
o1 = { x: c, 0: a }; // string indexer is any, number indexer is A
|
||||
~
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
!!! error TS2741: Property 'y' is missing in type 'A' but required in type 'B'.
|
||||
!!! related TS2728 objectLiteralIndexerErrors.ts:6:5: 'y' is declared here.
|
||||
!!! related TS6501 objectLiteralIndexerErrors.ts:13:26: The expected type comes from this index signature.
|
||||
@@ -5,6 +5,7 @@ objectSpreadStrictNull.ts(14,9): error TS2322: Type '{ sn: number | undefined; }
|
||||
objectSpreadStrictNull.ts(15,9): error TS2322: Type '{ sn: number | undefined; }' is not assignable to type '{ sn: string | number; }'.
|
||||
Types of property 'sn' are incompatible.
|
||||
Type 'number | undefined' is not assignable to type 'string | number'.
|
||||
Type 'undefined' is not assignable to type 'string | number'.
|
||||
objectSpreadStrictNull.ts(18,9): error TS2322: Type '{ sn: string | number | undefined; }' is not assignable to type '{ sn: string | number | boolean; }'.
|
||||
Types of property 'sn' are incompatible.
|
||||
Type 'string | number | undefined' is not assignable to type 'string | number | boolean'.
|
||||
@@ -41,6 +42,7 @@ objectSpreadStrictNull.ts(42,5): error TS2322: Type '{ foo: number | undefined;
|
||||
!!! error TS2322: Type '{ sn: number | undefined; }' is not assignable to type '{ sn: string | number; }'.
|
||||
!!! error TS2322: Types of property 'sn' are incompatible.
|
||||
!!! error TS2322: Type 'number | undefined' is not assignable to type 'string | number'.
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'.
|
||||
let allUndefined: { sn: string | number | undefined } = { ...undefinedString, ...undefinedNumber };
|
||||
|
||||
let undefinedWithOptionalContinues: { sn: string | number | boolean } = { ...definiteBoolean, ...undefinedString, ...optionalNumber };
|
||||
|
||||
+8
-6
@@ -4,17 +4,18 @@ objectTypeWithStringAndNumberIndexSignatureToAny.ts(49,5): error TS2739: Type 'S
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(50,5): error TS2739: Type 'NumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(51,5): error TS2739: Type 'StringAndNumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(61,5): error TS2322: Type 'Obj' is not assignable to type 'NumberTo<any>'.
|
||||
Index signature for type 'number' is missing in type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(65,5): error TS2322: Type 'Obj' is not assignable to type 'StringTo<any> & NumberTo<any>'.
|
||||
Type 'Obj' is not assignable to type 'NumberTo<any>'.
|
||||
Index signature for type 'number' is missing in type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(67,5): error TS2322: Type 'StringTo<any>' is not assignable to type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(68,5): error TS2322: Type 'NumberTo<any>' is not assignable to type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(67,5): error TS2739: Type 'StringTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(68,5): error TS2739: Type 'NumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(69,5): error TS2739: Type 'StringTo<any> & NumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(84,5): error TS2322: Type 'Obj' is not assignable to type 'NumberToNumber'.
|
||||
Index signature for type 'number' is missing in type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(88,5): error TS2322: Type 'Obj' is not assignable to type 'StringToAnyNumberToNumber'.
|
||||
Index signature for type 'number' is missing in type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(90,5): error TS2322: Type 'StringTo<any>' is not assignable to type 'Obj'.
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(90,5): error TS2739: Type 'StringTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
objectTypeWithStringAndNumberIndexSignatureToAny.ts(91,5): error TS2739: Type 'NumberTo<number>' is missing the following properties from type 'Obj': hello, world
|
||||
|
||||
|
||||
@@ -91,6 +92,7 @@ objectTypeWithStringAndNumberIndexSignatureToAny.ts(91,5): error TS2739: Type 'N
|
||||
nToAny = someObj;
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'Obj' is not assignable to type 'NumberTo<any>'.
|
||||
!!! error TS2322: Index signature for type 'number' is missing in type 'Obj'.
|
||||
|
||||
bothToAny = sToAny;
|
||||
bothToAny = nToAny;
|
||||
@@ -102,10 +104,10 @@ objectTypeWithStringAndNumberIndexSignatureToAny.ts(91,5): error TS2739: Type 'N
|
||||
|
||||
someObj = sToAny;
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'StringTo<any>' is not assignable to type 'Obj'.
|
||||
!!! error TS2739: Type 'StringTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
someObj = nToAny;
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'NumberTo<any>' is not assignable to type 'Obj'.
|
||||
!!! error TS2739: Type 'NumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
someObj = bothToAny;
|
||||
~~~~~~~
|
||||
!!! error TS2739: Type 'StringTo<any> & NumberTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
@@ -137,7 +139,7 @@ objectTypeWithStringAndNumberIndexSignatureToAny.ts(91,5): error TS2739: Type 'N
|
||||
|
||||
someObj = sToAny;
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type 'StringTo<any>' is not assignable to type 'Obj'.
|
||||
!!! error TS2739: Type 'StringTo<any>' is missing the following properties from type 'Obj': hello, world
|
||||
someObj = nToNumber;
|
||||
~~~~~~~
|
||||
!!! error TS2739: Type 'NumberTo<number>' is missing the following properties from type 'Obj': hello, world
|
||||
|
||||
+18
-8
@@ -17,12 +17,13 @@ overloadresolutionWithConstraintCheckingDeferred.ts(16,23): error TS2769: No ove
|
||||
Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'B' is not assignable to type 'D'.
|
||||
Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
Property 'x' is missing in type 'D' but required in type 'A'.
|
||||
overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: D) => number'.
|
||||
@@ -30,12 +31,13 @@ overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2769: No ove
|
||||
Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'B' is not assignable to type 'D'.
|
||||
Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
Property 'x' is missing in type 'D' but required in type 'A'.
|
||||
|
||||
|
||||
==== overloadresolutionWithConstraintCheckingDeferred.ts (6 errors) ====
|
||||
@@ -81,14 +83,18 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type '
|
||||
!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
!!! error TS2769: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2769: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
!!! error TS2769: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2769: Type 'B' is not assignable to type 'D'.
|
||||
!!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
!!! related TS6502 overloadresolutionWithConstraintCheckingDeferred.ts:10:27: The expected type comes from the return type of this signature.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here.
|
||||
~~~~~~~~
|
||||
!!! error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
!!! error TS2344: Property 'x' is missing in type 'D' but required in type 'A'.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here.
|
||||
|
||||
var result3: string = foo(x => { // x has type D
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -99,14 +105,18 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type '
|
||||
!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
!!! error TS2769: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2769: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
!!! error TS2769: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2769: Type 'B' is not assignable to type 'D'.
|
||||
!!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here.
|
||||
var y: G<typeof x>; // error that D does not satisfy constraint, y is of type G<D>, entire call to foo is an error
|
||||
~~~~~~~~
|
||||
!!! error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
!!! error TS2344: Property 'x' is missing in type 'D' but required in type 'A'.
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here.
|
||||
return y;
|
||||
});
|
||||
|
||||
@@ -63,6 +63,8 @@ promisePermutations.ts(106,19): error TS2769: No overload matches this call.
|
||||
promisePermutations.ts(109,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
promisePermutations.ts(110,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
@@ -114,9 +116,12 @@ promisePermutations.ts(137,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations.ts(144,35): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations.ts(152,36): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
|
||||
@@ -130,6 +135,7 @@ promisePermutations.ts(158,21): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
promisePermutations.ts(159,21): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
|
||||
@@ -350,6 +356,8 @@ promisePermutations.ts(160,21): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible.
|
||||
!!! error TS2769: Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
!!! related TS2771 promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
@@ -453,6 +461,7 @@ promisePermutations.ts(160,21): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2769: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2771 promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -465,6 +474,8 @@ promisePermutations.ts(160,21): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2769: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2771 promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s10 = testFunction10P(x => x);
|
||||
@@ -499,6 +510,7 @@ promisePermutations.ts(160,21): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
!!! error TS2769: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
!!! error TS2769: Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2771 promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -43,6 +43,8 @@ promisePermutations2.ts(105,19): error TS2769: No overload matches this call.
|
||||
promisePermutations2.ts(108,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
promisePermutations2.ts(109,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
@@ -80,9 +82,12 @@ promisePermutations2.ts(133,19): error TS2345: Argument of type '<T>(x: T, cb: <
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations2.ts(143,35): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
|
||||
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
|
||||
promisePermutations2.ts(155,21): error TS2769: No overload matches this call.
|
||||
@@ -92,6 +97,7 @@ promisePermutations2.ts(155,21): error TS2769: No overload matches this call.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
@@ -277,6 +283,8 @@ promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number):
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible.
|
||||
!!! error TS2769: Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
!!! related TS2771 promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
@@ -360,6 +368,7 @@ promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number):
|
||||
~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2345: Type 'string' is not assignable to type 'number'.
|
||||
var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
var r10 = testFunction10(x => x);
|
||||
@@ -371,6 +380,8 @@ promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number):
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2769: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2771 promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s10 = testFunction10P(x => x);
|
||||
@@ -400,6 +411,7 @@ promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number):
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
!!! error TS2345: Type 'number' is not assignable to type 'string'.
|
||||
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
|
||||
|
||||
@@ -56,6 +56,8 @@ promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: <T>(a: T)
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
promisePermutations3.ts(108,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
promisePermutations3.ts(109,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
@@ -97,7 +99,10 @@ promisePermutations3.ts(136,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
promisePermutations3.ts(151,36): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
|
||||
@@ -109,6 +114,7 @@ promisePermutations3.ts(157,21): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
promisePermutations3.ts(158,21): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
|
||||
@@ -320,6 +326,8 @@ promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IP
|
||||
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
|
||||
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
@@ -407,6 +415,7 @@ promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IP
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2769: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2771 promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -417,6 +426,8 @@ promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IP
|
||||
var r10d = r10.then(testFunction, sIPromise, nIPromise); // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
!!! error TS2345: Type 'string' is not assignable to type 'number'.
|
||||
var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s10 = testFunction10P(x => x);
|
||||
var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok
|
||||
@@ -447,6 +458,7 @@ promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IP
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
|
||||
!!! error TS2769: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
|
||||
!!! error TS2769: Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2771 promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
promisesWithConstraints.ts(15,1): error TS2322: Type 'Promise<Foo>' is not assignable to type 'Promise<Bar>'.
|
||||
Property 'y' is missing in type 'Foo' but required in type 'Bar'.
|
||||
promisesWithConstraints.ts(20,1): error TS2322: Type 'CPromise<Foo>' is not assignable to type 'CPromise<Bar>'.
|
||||
Type 'Foo' is not assignable to type 'Bar'.
|
||||
Property 'y' is missing in type 'Foo' but required in type 'Bar'.
|
||||
|
||||
|
||||
==== promisesWithConstraints.ts (2 errors) ====
|
||||
@@ -31,5 +31,6 @@ promisesWithConstraints.ts(20,1): error TS2322: Type 'CPromise<Foo>' is not assi
|
||||
b2 = a2; // was error
|
||||
~~
|
||||
!!! error TS2322: Type 'CPromise<Foo>' is not assignable to type 'CPromise<Bar>'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'Bar'.
|
||||
!!! error TS2322: Property 'y' is missing in type 'Foo' but required in type 'Bar'.
|
||||
!!! related TS2728 promisesWithConstraints.ts:10:20: 'y' is declared here.
|
||||
|
||||
@@ -5,6 +5,8 @@ reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2769: No overload matches
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
Overload 2 of 2, '(props: Props, context?: any): FieldFeedback<Props>', gave the following error.
|
||||
Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'.
|
||||
Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(props: Readonly<Props>): FieldFeedbackBeta<Props>', gave the following error.
|
||||
Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'.
|
||||
@@ -12,12 +14,15 @@ reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2769: No overload matches
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta<Props>', gave the following error.
|
||||
Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'.
|
||||
Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(props: Readonly<MyPropsProps>): FieldFeedback2<MyPropsProps>', gave the following error.
|
||||
Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2<MyPropsProps>', gave the following error.
|
||||
Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
Type 'void' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== reactDefaultPropsInferenceSuccess.tsx (3 errors) ====
|
||||
@@ -56,6 +61,8 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback<Props>', gave the following error.
|
||||
!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'.
|
||||
!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback<Props>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "children" | "error"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback<Props>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "children" | "error"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
|
||||
|
||||
@@ -82,6 +89,8 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta<Props>', gave the following error.
|
||||
!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'.
|
||||
!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedbackBeta<Props>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "children"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, keyof Props>> & Partial<Pick<BaseProps, never>>'
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedbackBeta<Props>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "children"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, keyof Props>> & Partial<Pick<BaseProps, never>>'
|
||||
|
||||
@@ -112,6 +121,7 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2<MyPropsProps>', gave the following error.
|
||||
!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
|
||||
!!! error TS2769: Type 'void' is not assignable to type 'boolean'.
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback2<MyPropsProps>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "children" | "error"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
|
||||
!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback2<MyPropsProps>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "children" | "error"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): error TS2344: Type 'G
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
|
||||
|
||||
==== reactReduxLikeDeferredInferenceAllowsAssignment.ts (1 errors) ====
|
||||
@@ -96,6 +99,9 @@ reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): error TS2344: Type 'G
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof TInjectedProps & string] | TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
>;
|
||||
|
||||
declare const connect: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
relationComplexityError.ts(12,5): error TS2322: Type 'T1 & T2' is not assignable to type 'T1 | null'.
|
||||
relationComplexityError.ts(12,5): error TS2859: Excessive complexity comparing types 'T1 & T2' and 'T1 | null'.
|
||||
relationComplexityError.ts(12,5): error TS2859: Excessive complexity comparing types 'T1 & T2' and 'T1 | null'.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ relationComplexityError.ts(12,5): error TS2859: Excessive complexity comparing t
|
||||
function f2(x: T1 | null, y: T1 & T2) {
|
||||
x = y; // Complexity error
|
||||
~
|
||||
!!! error TS2322: Type 'T1 & T2' is not assignable to type 'T1 | null'.
|
||||
!!! error TS2859: Excessive complexity comparing types 'T1 & T2' and 'T1 | null'.
|
||||
~~~~~
|
||||
!!! error TS2859: Excessive complexity comparing types 'T1 & T2' and 'T1 | null'.
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
setMethods.ts(13,17): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(19,24): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(25,22): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(31,31): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(37,22): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(43,24): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
|
||||
|
||||
==== setMethods.ts (7 errors) ====
|
||||
@@ -33,6 +39,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.intersection([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.intersection(new Set);
|
||||
numberSet.intersection(stringSet);
|
||||
numberSet.intersection(numberMap);
|
||||
@@ -41,6 +48,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.difference([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.difference(new Set);
|
||||
numberSet.difference(stringSet);
|
||||
numberSet.difference(numberMap);
|
||||
@@ -49,6 +57,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.symmetricDifference([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.symmetricDifference(new Set);
|
||||
numberSet.symmetricDifference(stringSet);
|
||||
numberSet.symmetricDifference(numberMap);
|
||||
@@ -57,6 +66,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.isSubsetOf([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.isSubsetOf(new Set);
|
||||
numberSet.isSubsetOf(stringSet);
|
||||
numberSet.isSubsetOf(numberMap);
|
||||
@@ -65,6 +75,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.isSupersetOf([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.isSupersetOf(new Set);
|
||||
numberSet.isSupersetOf(stringSet);
|
||||
numberSet.isSupersetOf(numberMap);
|
||||
@@ -73,6 +84,7 @@ setMethods.ts(49,26): error TS2345: Argument of type 'undefined[]' is not assign
|
||||
numberSet.isDisjointFrom([]);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'ReadonlySetLike<unknown>'.
|
||||
!!! error TS2345: Type 'undefined[]' is missing the following properties from type 'ReadonlySetLike<unknown>': has, size
|
||||
numberSet.isDisjointFrom(new Set);
|
||||
numberSet.isDisjointFrom(stringSet);
|
||||
numberSet.isDisjointFrom(numberMap);
|
||||
|
||||
@@ -39,14 +39,18 @@ strictFunctionTypesErrors.ts(61,1): error TS2322: Type 'Func<Func<Object, void>,
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(62,1): error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, Object>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(65,1): error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(66,1): error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(67,1): error TS2322: Type 'Func<Func<string, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(74,1): error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(75,1): error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(76,1): error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
|
||||
@@ -57,32 +61,34 @@ strictFunctionTypesErrors.ts(80,1): error TS2322: Type 'Func<string, Func<string
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(83,1): error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(84,1): error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
|
||||
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
Type 'Object' is not assignable to type 'string'.
|
||||
strictFunctionTypesErrors.ts(111,1): error TS2322: Type 'Comparer2<Dog>' is not assignable to type 'Comparer2<Animal>'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(126,1): error TS2322: Type 'Crate<Dog>' is not assignable to type 'Crate<Animal>'.
|
||||
Types of property 'onSetItem' are incompatible.
|
||||
Type '(item: Dog) => void' is not assignable to type '(item: Animal) => void'.
|
||||
Types of parameters 'item' and 'item' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Crate<Animal>' is not assignable to type 'Crate<Dog>'.
|
||||
Types of property 'item' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(133,1): error TS2328: Types of parameters 'f' and 'f' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'.
|
||||
Types of parameters 'f' and 'f' are incompatible.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(147,5): error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'.
|
||||
Types of parameters 'cb' and 'cb' are incompatible.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'.
|
||||
Types of parameters 'cb' and 'cb' are incompatible.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'Animal' is not assignable to type 'Dog'.
|
||||
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
|
||||
|
||||
==== strictFunctionTypesErrors.ts (35 errors) ====
|
||||
@@ -207,16 +213,19 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, Object>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
h3 = h4; // Ok
|
||||
|
||||
h4 = h1; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
h4 = h2; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
h4 = h3; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Func<string, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
|
||||
@@ -231,6 +240,7 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
i1 = i3; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
|
||||
@@ -255,10 +265,12 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
i3 = i4; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
|
||||
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
|
||||
|
||||
i4 = i1; // Ok
|
||||
i4 = i2; // Ok
|
||||
@@ -310,12 +322,14 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
!!! error TS2322: Types of property 'onSetItem' are incompatible.
|
||||
!!! error TS2322: Type '(item: Dog) => void' is not assignable to type '(item: Animal) => void'.
|
||||
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
|
||||
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2322: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
dogCrate = animalCrate; // Error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type 'Crate<Animal>' is not assignable to type 'Crate<Dog>'.
|
||||
!!! error TS2322: Types of property 'item' are incompatible.
|
||||
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2322: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
|
||||
// Verify that callback parameters are strictly checked
|
||||
|
||||
@@ -324,13 +338,15 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
fc1 = fc2; // Error
|
||||
~~~
|
||||
!!! error TS2328: Types of parameters 'f' and 'f' are incompatible.
|
||||
!!! error TS2328: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2328: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
fc2 = fc1; // Error
|
||||
~~~
|
||||
!!! error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'.
|
||||
!!! error TS2322: Types of parameters 'f' and 'f' are incompatible.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2322: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
|
||||
// Verify that callback parameters aren't loosely checked when types
|
||||
// originate in method declarations
|
||||
@@ -348,7 +364,8 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
!!! error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'.
|
||||
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2322: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
}
|
||||
|
||||
namespace n2 {
|
||||
@@ -361,5 +378,6 @@ strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Ani
|
||||
!!! error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'.
|
||||
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
|
||||
!!! error TS2322: Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
|
||||
!!! related TS2728 strictFunctionTypesErrors.ts:91:32: 'dog' is declared here.
|
||||
}
|
||||
@@ -18,6 +18,7 @@ stringMappingOverPatternLiterals.ts(57,5): error TS2322: Type 'string' is not as
|
||||
stringMappingOverPatternLiterals.ts(78,5): error TS2322: Type 'Uppercase<string>' is not assignable to type 'Uppercase<Lowercase<string>>'.
|
||||
Type 'string' is not assignable to type 'Lowercase<string>'.
|
||||
stringMappingOverPatternLiterals.ts(79,5): error TS2322: Type 'Uppercase<string>' is not assignable to type 'Uppercase<Lowercase<string>>'.
|
||||
Type 'string' is not assignable to type 'Lowercase<string>'.
|
||||
stringMappingOverPatternLiterals.ts(83,5): error TS2322: Type 'Lowercase<Uppercase<string>>' is not assignable to type 'Uppercase<string>'.
|
||||
stringMappingOverPatternLiterals.ts(84,5): error TS2322: Type 'Lowercase<Uppercase<string>>' is not assignable to type 'Uppercase<string>'.
|
||||
stringMappingOverPatternLiterals.ts(85,5): error TS2322: Type 'Lowercase<Uppercase<string>>' is not assignable to type 'Uppercase<Lowercase<string>>'.
|
||||
@@ -27,11 +28,15 @@ stringMappingOverPatternLiterals.ts(89,5): error TS2322: Type 'Uppercase<Lowerca
|
||||
stringMappingOverPatternLiterals.ts(129,5): error TS2322: Type 'Capitalize<string>' is not assignable to type '`A${string}`'.
|
||||
Type 'string' is not assignable to type '`A${string}`'.
|
||||
stringMappingOverPatternLiterals.ts(130,5): error TS2322: Type 'Capitalize<string>' is not assignable to type '`A${string}`'.
|
||||
Type 'string' is not assignable to type '`A${string}`'.
|
||||
stringMappingOverPatternLiterals.ts(131,5): error TS2322: Type 'Capitalize<string>' is not assignable to type '`A${string}`'.
|
||||
Type 'string' is not assignable to type '`A${string}`'.
|
||||
stringMappingOverPatternLiterals.ts(147,5): error TS2322: Type 'Uncapitalize<string>' is not assignable to type '`a${string}`'.
|
||||
Type 'string' is not assignable to type '`a${string}`'.
|
||||
stringMappingOverPatternLiterals.ts(148,5): error TS2322: Type 'Uncapitalize<string>' is not assignable to type '`a${string}`'.
|
||||
Type 'string' is not assignable to type '`a${string}`'.
|
||||
stringMappingOverPatternLiterals.ts(149,5): error TS2322: Type 'Uncapitalize<string>' is not assignable to type '`a${string}`'.
|
||||
Type 'string' is not assignable to type '`a${string}`'.
|
||||
|
||||
|
||||
==== stringMappingOverPatternLiterals.ts (29 errors) ====
|
||||
@@ -151,6 +156,7 @@ stringMappingOverPatternLiterals.ts(149,5): error TS2322: Type 'Uncapitalize<str
|
||||
x3 = x2;
|
||||
~~
|
||||
!!! error TS2322: Type 'Uppercase<string>' is not assignable to type 'Uppercase<Lowercase<string>>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'Lowercase<string>'.
|
||||
|
||||
// and this should also not be equivlent to any others
|
||||
var x4: Lowercase<Uppercase<string>> = null as any;
|
||||
@@ -219,9 +225,11 @@ stringMappingOverPatternLiterals.ts(149,5): error TS2322: Type 'Uncapitalize<str
|
||||
cap_tem_map = cap_str;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Capitalize<string>' is not assignable to type '`A${string}`'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type '`A${string}`'.
|
||||
cap_tem_map2 = cap_str;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Capitalize<string>' is not assignable to type '`A${string}`'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type '`A${string}`'.
|
||||
|
||||
// All these are uncapitalized
|
||||
uncap_str = uncap_tem;
|
||||
@@ -244,7 +252,9 @@ stringMappingOverPatternLiterals.ts(149,5): error TS2322: Type 'Uncapitalize<str
|
||||
uncap_tem_map = uncap_str;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uncapitalize<string>' is not assignable to type '`a${string}`'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type '`a${string}`'.
|
||||
uncap_tem_map2 = uncap_str;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Uncapitalize<string>' is not assignable to type '`a${string}`'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type '`a${string}`'.
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
file1.js(2,7): error TS2322: Type 'C' is not assignable to type 'ClassComponent<any>'.
|
||||
Index signature for type 'number' is missing in type 'C'.
|
||||
tile1.ts(2,30): error TS2344: Type 'State' does not satisfy the constraint 'Lifecycle<Attrs, State>'.
|
||||
tile1.ts(6,81): error TS2744: Type parameter defaults can only reference previously declared type parameters.
|
||||
tile1.ts(11,40): error TS2344: Type 'State' does not satisfy the constraint 'Lifecycle<Attrs, State>'.
|
||||
@@ -62,4 +63,5 @@ tile1.ts(24,7): error TS2322: Type 'C' is not assignable to type 'ClassComponent
|
||||
const test9 = new C();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'ClassComponent<any>'.
|
||||
!!! error TS2322: Index signature for type 'number' is missing in type 'C'.
|
||||
|
||||
@@ -2,6 +2,7 @@ subtypingWithNumericIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly
|
||||
'number' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithNumericIndexer2.ts(24,27): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithNumericIndexer2.ts(32,15): error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
'number' index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
@@ -48,6 +49,8 @@ subtypingWithNumericIndexer2.ts(40,15): error TS2430: Interface 'B5<T>' incorrec
|
||||
interface B extends A<Base> {
|
||||
~~~~
|
||||
!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
!!! error TS2344: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithNumericIndexer2.ts:4:34: 'bar' is declared here.
|
||||
[x: number]: Derived; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ subtypingWithNumericIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly exten
|
||||
'number' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithNumericIndexer3.ts(24,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithNumericIndexer3.ts(32,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
'number' index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
@@ -48,6 +49,8 @@ subtypingWithNumericIndexer3.ts(40,11): error TS2415: Class 'B5<T>' incorrectly
|
||||
class B extends A<Base> {
|
||||
~~~~
|
||||
!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
!!! error TS2344: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithNumericIndexer3.ts:4:34: 'bar' is declared here.
|
||||
[x: number]: Derived; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@ subtypingWithObjectMembers3.ts(17,15): error TS2430: Interface 'B' incorrectly e
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithObjectMembers3.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'.
|
||||
Types of property '2.0' are incompatible.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithObjectMembers3.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'.
|
||||
Types of property ''2.0'' are incompatible.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithObjectMembers3.ts(49,15): error TS2430: Interface 'B' incorrectly extends interface 'A'.
|
||||
Types of property 'bar' are incompatible.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithObjectMembers3.ts(59,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'.
|
||||
Types of property '2.0' are incompatible.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'.
|
||||
Types of property ''2.0'' are incompatible.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
|
||||
|
||||
==== subtypingWithObjectMembers3.ts (6 errors) ====
|
||||
@@ -54,7 +54,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly
|
||||
~~
|
||||
!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'.
|
||||
!!! error TS2430: Types of property '2.0' are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'Derived'.
|
||||
!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithObjectMembers3.ts:6:5: 'bar' is declared here.
|
||||
1: Derived; // ok
|
||||
2: Base; // error
|
||||
}
|
||||
@@ -68,7 +69,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly
|
||||
~~
|
||||
!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'.
|
||||
!!! error TS2430: Types of property ''2.0'' are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'Derived'.
|
||||
!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithObjectMembers3.ts:6:5: 'bar' is declared here.
|
||||
'1': Derived; // ok
|
||||
'2.0': Base; // error
|
||||
}
|
||||
@@ -84,7 +86,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly
|
||||
~
|
||||
!!! error TS2430: Interface 'B' incorrectly extends interface 'A'.
|
||||
!!! error TS2430: Types of property 'bar' are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'Derived'.
|
||||
!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithObjectMembers3.ts:6:5: 'bar' is declared here.
|
||||
foo?: Derived; // ok
|
||||
bar?: Base; // error
|
||||
}
|
||||
@@ -98,7 +101,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly
|
||||
~~
|
||||
!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'.
|
||||
!!! error TS2430: Types of property '2.0' are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'Derived'.
|
||||
!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithObjectMembers3.ts:6:5: 'bar' is declared here.
|
||||
1?: Derived; // ok
|
||||
2?: Base; // error
|
||||
}
|
||||
@@ -112,7 +116,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly
|
||||
~~
|
||||
!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'.
|
||||
!!! error TS2430: Types of property ''2.0'' are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'Derived'.
|
||||
!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithObjectMembers3.ts:6:5: 'bar' is declared here.
|
||||
'1'?: Derived; // ok
|
||||
'2.0'?: Base; // error
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ subtypingWithStringIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly e
|
||||
'string' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithStringIndexer2.ts(24,27): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithStringIndexer2.ts(32,15): error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
'string' index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
@@ -48,6 +49,8 @@ subtypingWithStringIndexer2.ts(40,15): error TS2430: Interface 'B5<T>' incorrect
|
||||
interface B extends A<Base> {
|
||||
~~~~
|
||||
!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
!!! error TS2344: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithStringIndexer2.ts:4:34: 'bar' is declared here.
|
||||
[x: string]: Derived; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ subtypingWithStringIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extend
|
||||
'string' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithStringIndexer3.ts(24,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
subtypingWithStringIndexer3.ts(32,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
'string' index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
@@ -48,6 +49,8 @@ subtypingWithStringIndexer3.ts(40,11): error TS2415: Class 'B5<T>' incorrectly e
|
||||
class B extends A<Base> {
|
||||
~~~~
|
||||
!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'.
|
||||
!!! error TS2344: Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
!!! related TS2728 subtypingWithStringIndexer3.ts:4:34: 'bar' is declared here.
|
||||
[x: string]: Derived; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
@@ -43,30 +50,44 @@ taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1
|
||||
var b = foo([], 1); // string
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var c = foo([], 1, 2); // boolean
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var d = foo([], 1, true); // boolean (with error)
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var e = foo([], 1, "2"); // {}
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var f = foo([], 1, 2, 3); // any (with error)
|
||||
~
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
@@ -43,30 +50,44 @@ taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expect
|
||||
var b = foo([], 1); // string
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var c = foo([], 1, 2); // boolean
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var d = foo([], 1, true); // boolean (with error)
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var e = foo([], 1, "2"); // {}
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here.
|
||||
!!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
var f = foo([], 1, 2, 3); // any (with error)
|
||||
~
|
||||
|
||||
@@ -38,20 +38,22 @@ thisTypeInFunctionsNegative.ts(108,1): error TS2322: Type '(this: { x: number; }
|
||||
Property 'x' is missing in type '{ n: number; }' but required in type '{ x: number; }'.
|
||||
thisTypeInFunctionsNegative.ts(110,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
thisTypeInFunctionsNegative.ts(111,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
thisTypeInFunctionsNegative.ts(112,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
thisTypeInFunctionsNegative.ts(113,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'C' is not assignable to type 'D'.
|
||||
Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
thisTypeInFunctionsNegative.ts(114,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: { n: number; }, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type '{ n: number; }' is missing the following properties from type 'D': x, explicitThis, explicitD
|
||||
thisTypeInFunctionsNegative.ts(115,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
thisTypeInFunctionsNegative.ts(116,1): error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: void, m: number) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'void' is not assignable to type 'D'.
|
||||
@@ -64,8 +66,10 @@ thisTypeInFunctionsNegative.ts(145,1): error TS2322: Type '(this: Base2) => numb
|
||||
Property 'y' is missing in type 'Base1' but required in type 'Base2'.
|
||||
thisTypeInFunctionsNegative.ts(146,1): error TS2322: Type '(this: Base2) => number' is not assignable to type '(this: Base1) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Type 'Base1' is not assignable to type 'Base2'.
|
||||
Property 'y' is missing in type 'Base1' but required in type 'Base2'.
|
||||
thisTypeInFunctionsNegative.ts(148,1): error TS2322: Type '(this: Base2) => number' is not assignable to type '(this: Base1) => number'.
|
||||
The 'this' types of each signature are incompatible.
|
||||
Property 'y' is missing in type 'Base1' but required in type 'Base2'.
|
||||
thisTypeInFunctionsNegative.ts(154,16): error TS2679: A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'.
|
||||
thisTypeInFunctionsNegative.ts(158,17): error TS2681: A constructor cannot have a 'this' parameter.
|
||||
thisTypeInFunctionsNegative.ts(162,9): error TS2681: A constructor cannot have a 'this' parameter.
|
||||
@@ -278,22 +282,22 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2322: Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
c.explicitC = d.explicitThis;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2322: Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
c.explicitThis = d.explicitD;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2322: Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
c.explicitThis = d.explicitThis;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'D'.
|
||||
!!! error TS2322: Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
c.explicitProperty = d.explicitD;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: { n: number; }, m: number) => number'.
|
||||
@@ -302,6 +306,8 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h
|
||||
c.explicitThis = d.explicitThis;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: C, m: number) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'C' is missing the following properties from type 'D': x, explicitD
|
||||
c.explicitVoid = d.explicitD;
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: D, m: number) => number' is not assignable to type '(this: void, m: number) => number'.
|
||||
@@ -351,11 +357,15 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: Base2) => number' is not assignable to type '(this: Base1) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Type 'Base1' is not assignable to type 'Base2'.
|
||||
!!! error TS2322: Property 'y' is missing in type 'Base1' but required in type 'Base2'.
|
||||
!!! related TS2728 thisTypeInFunctionsNegative.ts:131:5: 'y' is declared here.
|
||||
|
||||
d1.explicit = b2.polymorphic // error, 'y' not in Base1: { x }
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(this: Base2) => number' is not assignable to type '(this: Base1) => number'.
|
||||
!!! error TS2322: The 'this' types of each signature are incompatible.
|
||||
!!! error TS2322: Property 'y' is missing in type 'Base1' but required in type 'Base2'.
|
||||
!!! related TS2728 thisTypeInFunctionsNegative.ts:131:5: 'y' is declared here.
|
||||
|
||||
////// use this-type for construction with new ////
|
||||
function VoidThis(this: void) {
|
||||
|
||||
@@ -13,6 +13,7 @@ tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this
|
||||
Type 'P' is not assignable to type 'IntrinsicAttributes'.
|
||||
Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error.
|
||||
Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComponent> & Readonly<{ children?: ReactNode; }> & Readonly<P>'.
|
||||
Type 'P' is not assignable to type 'IntrinsicAttributes'.
|
||||
|
||||
|
||||
==== tsxNotUsingApparentTypeOfSFC.tsx (4 errors) ====
|
||||
@@ -54,7 +55,9 @@ tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this
|
||||
!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error.
|
||||
!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComponent> & Readonly<{ children?: ReactNode; }> & Readonly<P>'.
|
||||
!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes` constraint.
|
||||
!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes & JSX.IntrinsicClassAttributes<MyComponent> & Readonly<{ children?: React.ReactNode; }> & Readonly<P>` constraint.
|
||||
!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes` constraint.
|
||||
!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes & JSX.IntrinsicClassAttributes<MyComponent> & Readonly<{ children?: React.ReactNode; }> & Readonly<P>` constraint.
|
||||
}
|
||||
@@ -8,6 +8,8 @@ file.tsx(39,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a:
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
file.tsx(41,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3.
|
||||
file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3.
|
||||
file.tsx(51,47): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
@@ -76,6 +78,8 @@ file.tsx(53,47): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
x = <MyComp2<Prop> a={10} b="hi"></MyComp2>; // error
|
||||
~~~~
|
||||
!!! error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'.
|
||||
!!! error TS2344: Types of property 'a' are incompatible.
|
||||
!!! error TS2344: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
x = <MyComp2<{a: string}, {b: string}> a="hi" b="hi" />; // OK
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assign
|
||||
tupleTypes.ts(35,14): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'.
|
||||
tupleTypes.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'.
|
||||
tupleTypes.ts(41,1): error TS2322: Type '[]' is not assignable to type '[number, string]'.
|
||||
Source has 0 element(s) but target requires 2.
|
||||
tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
|
||||
Type 'string | number' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
@@ -96,6 +97,7 @@ tupleTypes.ts(63,4): error TS2540: Cannot assign to 'length' because it is a rea
|
||||
tt = []; // Error
|
||||
~~
|
||||
!!! error TS2322: Type '[]' is not assignable to type '[number, string]'.
|
||||
!!! error TS2322: Source has 0 element(s) but target requires 2.
|
||||
|
||||
var a: number[];
|
||||
var a1: [number, string];
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
typeAssignabilityErrorMessage.ts(14,5): error TS2739: Type 'ThroughStream' is missing the following properties from type 'ReadStream': f, g, h, i, j
|
||||
typeAssignabilityErrorMessage.ts(17,5): error TS2739: Type 'ThroughStream' is missing the following properties from type 'ReadStream': f, g, h, i, j
|
||||
typeAssignabilityErrorMessage.ts(40,5): error TS2322: Type 'Foo<string>' is not assignable to type 'Bar<number>'.
|
||||
Type 'Foo<string>' is not assignable to type '{ foo: { what: number; }; }'.
|
||||
The types of 'foo.what' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
typeAssignabilityErrorMessage.ts(42,5): error TS2345: Argument of type 'OtherWrap' is not assignable to parameter of type 'Wrap'.
|
||||
Types of property 'someProp' are incompatible.
|
||||
Type 'Foo<string>' is not assignable to type 'Bar<number>'.
|
||||
Type 'Foo<string>' is not assignable to type '{ foo: { what: number; }; }'.
|
||||
The types of 'foo.what' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== typeAssignabilityErrorMessage.ts (4 errors) ====
|
||||
// Example: different error code altogether
|
||||
|
||||
interface ThroughStream {
|
||||
a: string;
|
||||
}
|
||||
interface ReadStream {
|
||||
f: string;
|
||||
g: number;
|
||||
h: boolean;
|
||||
i: BigInt;
|
||||
j: symbol;
|
||||
}
|
||||
function foo(): ReadStream {
|
||||
return undefined as any as ThroughStream;
|
||||
~~~~~~
|
||||
!!! error TS2739: Type 'ThroughStream' is missing the following properties from type 'ReadStream': f, g, h, i, j
|
||||
}
|
||||
function bar(): ReadStream {
|
||||
return undefined as any as ThroughStream;
|
||||
~~~~~~
|
||||
!!! error TS2739: Type 'ThroughStream' is missing the following properties from type 'ReadStream': f, g, h, i, j
|
||||
}
|
||||
|
||||
// Example: different elaboration
|
||||
|
||||
type Wrap = {
|
||||
someProp: Bar<number>;
|
||||
}
|
||||
type OtherWrap = {
|
||||
someProp: Foo<string>;
|
||||
}
|
||||
type Foo<T> = {
|
||||
foo: { what: T };
|
||||
}
|
||||
type Bar<T> = {
|
||||
foo: { what: T };
|
||||
} | boolean;
|
||||
|
||||
function fun(param: Wrap): void {}
|
||||
|
||||
declare let fooStr: Foo<string>;
|
||||
declare let otherWrap: OtherWrap;
|
||||
|
||||
let a: Bar<number> = fooStr;
|
||||
~
|
||||
!!! error TS2322: Type 'Foo<string>' is not assignable to type 'Bar<number>'.
|
||||
!!! error TS2322: Type 'Foo<string>' is not assignable to type '{ foo: { what: number; }; }'.
|
||||
!!! error TS2322: The types of 'foo.what' are incompatible between these types.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
fun(otherWrap);
|
||||
~~~~~~~~~
|
||||
!!! error TS2345: Argument of type 'OtherWrap' is not assignable to parameter of type 'Wrap'.
|
||||
!!! error TS2345: Types of property 'someProp' are incompatible.
|
||||
!!! error TS2345: Type 'Foo<string>' is not assignable to type 'Bar<number>'.
|
||||
!!! error TS2345: Type 'Foo<string>' is not assignable to type '{ foo: { what: number; }; }'.
|
||||
!!! error TS2345: The types of 'foo.what' are incompatible between these types.
|
||||
!!! error TS2345: Type 'string' is not assignable to type 'number'.
|
||||
@@ -0,0 +1,105 @@
|
||||
//// [tests/cases/compiler/typeAssignabilityErrorMessage.ts] ////
|
||||
|
||||
=== typeAssignabilityErrorMessage.ts ===
|
||||
// Example: different error code altogether
|
||||
|
||||
interface ThroughStream {
|
||||
>ThroughStream : Symbol(ThroughStream, Decl(typeAssignabilityErrorMessage.ts, 0, 0))
|
||||
|
||||
a: string;
|
||||
>a : Symbol(ThroughStream.a, Decl(typeAssignabilityErrorMessage.ts, 2, 25))
|
||||
}
|
||||
interface ReadStream {
|
||||
>ReadStream : Symbol(ReadStream, Decl(typeAssignabilityErrorMessage.ts, 4, 1))
|
||||
|
||||
f: string;
|
||||
>f : Symbol(ReadStream.f, Decl(typeAssignabilityErrorMessage.ts, 5, 22))
|
||||
|
||||
g: number;
|
||||
>g : Symbol(ReadStream.g, Decl(typeAssignabilityErrorMessage.ts, 6, 14))
|
||||
|
||||
h: boolean;
|
||||
>h : Symbol(ReadStream.h, Decl(typeAssignabilityErrorMessage.ts, 7, 14))
|
||||
|
||||
i: BigInt;
|
||||
>i : Symbol(ReadStream.i, Decl(typeAssignabilityErrorMessage.ts, 8, 15))
|
||||
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))
|
||||
|
||||
j: symbol;
|
||||
>j : Symbol(ReadStream.j, Decl(typeAssignabilityErrorMessage.ts, 9, 14))
|
||||
}
|
||||
function foo(): ReadStream {
|
||||
>foo : Symbol(foo, Decl(typeAssignabilityErrorMessage.ts, 11, 1))
|
||||
>ReadStream : Symbol(ReadStream, Decl(typeAssignabilityErrorMessage.ts, 4, 1))
|
||||
|
||||
return undefined as any as ThroughStream;
|
||||
>undefined : Symbol(undefined)
|
||||
>ThroughStream : Symbol(ThroughStream, Decl(typeAssignabilityErrorMessage.ts, 0, 0))
|
||||
}
|
||||
function bar(): ReadStream {
|
||||
>bar : Symbol(bar, Decl(typeAssignabilityErrorMessage.ts, 14, 1))
|
||||
>ReadStream : Symbol(ReadStream, Decl(typeAssignabilityErrorMessage.ts, 4, 1))
|
||||
|
||||
return undefined as any as ThroughStream;
|
||||
>undefined : Symbol(undefined)
|
||||
>ThroughStream : Symbol(ThroughStream, Decl(typeAssignabilityErrorMessage.ts, 0, 0))
|
||||
}
|
||||
|
||||
// Example: different elaboration
|
||||
|
||||
type Wrap = {
|
||||
>Wrap : Symbol(Wrap, Decl(typeAssignabilityErrorMessage.ts, 17, 1))
|
||||
|
||||
someProp: Bar<number>;
|
||||
>someProp : Symbol(someProp, Decl(typeAssignabilityErrorMessage.ts, 21, 13))
|
||||
>Bar : Symbol(Bar, Decl(typeAssignabilityErrorMessage.ts, 29, 1))
|
||||
}
|
||||
type OtherWrap = {
|
||||
>OtherWrap : Symbol(OtherWrap, Decl(typeAssignabilityErrorMessage.ts, 23, 1))
|
||||
|
||||
someProp: Foo<string>;
|
||||
>someProp : Symbol(someProp, Decl(typeAssignabilityErrorMessage.ts, 24, 18))
|
||||
>Foo : Symbol(Foo, Decl(typeAssignabilityErrorMessage.ts, 26, 1))
|
||||
}
|
||||
type Foo<T> = {
|
||||
>Foo : Symbol(Foo, Decl(typeAssignabilityErrorMessage.ts, 26, 1))
|
||||
>T : Symbol(T, Decl(typeAssignabilityErrorMessage.ts, 27, 9))
|
||||
|
||||
foo: { what: T };
|
||||
>foo : Symbol(foo, Decl(typeAssignabilityErrorMessage.ts, 27, 15))
|
||||
>what : Symbol(what, Decl(typeAssignabilityErrorMessage.ts, 28, 10))
|
||||
>T : Symbol(T, Decl(typeAssignabilityErrorMessage.ts, 27, 9))
|
||||
}
|
||||
type Bar<T> = {
|
||||
>Bar : Symbol(Bar, Decl(typeAssignabilityErrorMessage.ts, 29, 1))
|
||||
>T : Symbol(T, Decl(typeAssignabilityErrorMessage.ts, 30, 9))
|
||||
|
||||
foo: { what: T };
|
||||
>foo : Symbol(foo, Decl(typeAssignabilityErrorMessage.ts, 30, 15))
|
||||
>what : Symbol(what, Decl(typeAssignabilityErrorMessage.ts, 31, 10))
|
||||
>T : Symbol(T, Decl(typeAssignabilityErrorMessage.ts, 30, 9))
|
||||
|
||||
} | boolean;
|
||||
|
||||
function fun(param: Wrap): void {}
|
||||
>fun : Symbol(fun, Decl(typeAssignabilityErrorMessage.ts, 32, 12))
|
||||
>param : Symbol(param, Decl(typeAssignabilityErrorMessage.ts, 34, 13))
|
||||
>Wrap : Symbol(Wrap, Decl(typeAssignabilityErrorMessage.ts, 17, 1))
|
||||
|
||||
declare let fooStr: Foo<string>;
|
||||
>fooStr : Symbol(fooStr, Decl(typeAssignabilityErrorMessage.ts, 36, 11))
|
||||
>Foo : Symbol(Foo, Decl(typeAssignabilityErrorMessage.ts, 26, 1))
|
||||
|
||||
declare let otherWrap: OtherWrap;
|
||||
>otherWrap : Symbol(otherWrap, Decl(typeAssignabilityErrorMessage.ts, 37, 11))
|
||||
>OtherWrap : Symbol(OtherWrap, Decl(typeAssignabilityErrorMessage.ts, 23, 1))
|
||||
|
||||
let a: Bar<number> = fooStr;
|
||||
>a : Symbol(a, Decl(typeAssignabilityErrorMessage.ts, 39, 3))
|
||||
>Bar : Symbol(Bar, Decl(typeAssignabilityErrorMessage.ts, 29, 1))
|
||||
>fooStr : Symbol(fooStr, Decl(typeAssignabilityErrorMessage.ts, 36, 11))
|
||||
|
||||
fun(otherWrap);
|
||||
>fun : Symbol(fun, Decl(typeAssignabilityErrorMessage.ts, 32, 12))
|
||||
>otherWrap : Symbol(otherWrap, Decl(typeAssignabilityErrorMessage.ts, 37, 11))
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//// [tests/cases/compiler/typeAssignabilityErrorMessage.ts] ////
|
||||
|
||||
=== typeAssignabilityErrorMessage.ts ===
|
||||
// Example: different error code altogether
|
||||
|
||||
interface ThroughStream {
|
||||
a: string;
|
||||
>a : string
|
||||
> : ^^^^^^
|
||||
}
|
||||
interface ReadStream {
|
||||
f: string;
|
||||
>f : string
|
||||
> : ^^^^^^
|
||||
|
||||
g: number;
|
||||
>g : number
|
||||
> : ^^^^^^
|
||||
|
||||
h: boolean;
|
||||
>h : boolean
|
||||
> : ^^^^^^^
|
||||
|
||||
i: BigInt;
|
||||
>i : BigInt
|
||||
> : ^^^^^^
|
||||
|
||||
j: symbol;
|
||||
>j : symbol
|
||||
> : ^^^^^^
|
||||
}
|
||||
function foo(): ReadStream {
|
||||
>foo : () => ReadStream
|
||||
> : ^^^^^^
|
||||
|
||||
return undefined as any as ThroughStream;
|
||||
>undefined as any as ThroughStream : ThroughStream
|
||||
> : ^^^^^^^^^^^^^
|
||||
>undefined as any : any
|
||||
> : ^^^
|
||||
>undefined : undefined
|
||||
> : ^^^^^^^^^
|
||||
}
|
||||
function bar(): ReadStream {
|
||||
>bar : () => ReadStream
|
||||
> : ^^^^^^
|
||||
|
||||
return undefined as any as ThroughStream;
|
||||
>undefined as any as ThroughStream : ThroughStream
|
||||
> : ^^^^^^^^^^^^^
|
||||
>undefined as any : any
|
||||
> : ^^^
|
||||
>undefined : undefined
|
||||
> : ^^^^^^^^^
|
||||
}
|
||||
|
||||
// Example: different elaboration
|
||||
|
||||
type Wrap = {
|
||||
>Wrap : Wrap
|
||||
> : ^^^^
|
||||
|
||||
someProp: Bar<number>;
|
||||
>someProp : Bar<number>
|
||||
> : ^^^^^^^^^^^
|
||||
}
|
||||
type OtherWrap = {
|
||||
>OtherWrap : OtherWrap
|
||||
> : ^^^^^^^^^
|
||||
|
||||
someProp: Foo<string>;
|
||||
>someProp : Foo<string>
|
||||
> : ^^^^^^^^^^^
|
||||
}
|
||||
type Foo<T> = {
|
||||
>Foo : Foo<T>
|
||||
> : ^^^^^^
|
||||
|
||||
foo: { what: T };
|
||||
>foo : { what: T; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>what : T
|
||||
> : ^
|
||||
}
|
||||
type Bar<T> = {
|
||||
>Bar : Bar<T>
|
||||
> : ^^^^^^
|
||||
|
||||
foo: { what: T };
|
||||
>foo : { what: T; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>what : T
|
||||
> : ^
|
||||
|
||||
} | boolean;
|
||||
|
||||
function fun(param: Wrap): void {}
|
||||
>fun : (param: Wrap) => void
|
||||
> : ^ ^^ ^^^^^
|
||||
>param : Wrap
|
||||
> : ^^^^
|
||||
|
||||
declare let fooStr: Foo<string>;
|
||||
>fooStr : Foo<string>
|
||||
> : ^^^^^^^^^^^
|
||||
|
||||
declare let otherWrap: OtherWrap;
|
||||
>otherWrap : OtherWrap
|
||||
> : ^^^^^^^^^
|
||||
|
||||
let a: Bar<number> = fooStr;
|
||||
>a : Bar<number>
|
||||
> : ^^^^^^^^^^^
|
||||
>fooStr : Foo<string>
|
||||
> : ^^^^^^^^^^^
|
||||
|
||||
fun(otherWrap);
|
||||
>fun(otherWrap) : void
|
||||
> : ^^^^
|
||||
>fun : (param: Wrap) => void
|
||||
> : ^ ^^ ^^^^^
|
||||
>otherWrap : OtherWrap
|
||||
> : ^^^^^^^^^
|
||||
|
||||
@@ -2,8 +2,8 @@ typeComparisonCaching.ts(26,1): error TS2322: Type 'B' is not assignable to type
|
||||
Types of property 's' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type 'C'.
|
||||
Types of property 'q' are incompatible.
|
||||
Type 'B' is not assignable to type 'A'.
|
||||
The types of 'q.s' are incompatible between these types.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== typeComparisonCaching.ts (2 errors) ====
|
||||
@@ -40,6 +40,6 @@ typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type
|
||||
c = d; // Should not be allowed
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'C'.
|
||||
!!! error TS2322: Types of property 'q' are incompatible.
|
||||
!!! error TS2322: Type 'B' is not assignable to type 'A'.
|
||||
!!! error TS2322: The types of 'q.s' are incompatible between these types.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
@@ -58,8 +58,12 @@ typeGuardFunctionErrors.ts(159,31): error TS2344: Type 'Bar' does not satisfy th
|
||||
Types of property ''a'' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
typeGuardFunctionErrors.ts(162,31): error TS2344: Type 'Bar' does not satisfy the constraint 'Foo'.
|
||||
Types of property ''a'' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
typeGuardFunctionErrors.ts(163,35): error TS2344: Type 'number' does not satisfy the constraint 'Foo'.
|
||||
typeGuardFunctionErrors.ts(164,51): error TS2344: Type 'Bar' does not satisfy the constraint 'Foo'.
|
||||
Types of property ''a'' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
typeGuardFunctionErrors.ts(165,51): error TS2344: Type 'number' does not satisfy the constraint 'Foo'.
|
||||
typeGuardFunctionErrors.ts(166,45): error TS2677: A type predicate's type must be assignable to its parameter's type.
|
||||
Type 'NeedsFoo<number>' is not assignable to type 'number'.
|
||||
@@ -342,12 +346,16 @@ typeGuardFunctionErrors.ts(166,54): error TS2344: Type 'number' does not satisfy
|
||||
declare var anError: NeedsFoo<Bar>; // error, as expected
|
||||
~~~
|
||||
!!! error TS2344: Type 'Bar' does not satisfy the constraint 'Foo'.
|
||||
!!! error TS2344: Types of property ''a'' are incompatible.
|
||||
!!! error TS2344: Type 'number' is not assignable to type 'string'.
|
||||
declare var alsoAnError: NeedsFoo<number>; // also error, as expected
|
||||
~~~~~~
|
||||
!!! error TS2344: Type 'number' does not satisfy the constraint 'Foo'.
|
||||
declare function newError1(x: any): x is NeedsFoo<Bar>; // should error
|
||||
~~~
|
||||
!!! error TS2344: Type 'Bar' does not satisfy the constraint 'Foo'.
|
||||
!!! error TS2344: Types of property ''a'' are incompatible.
|
||||
!!! error TS2344: Type 'number' is not assignable to type 'string'.
|
||||
declare function newError2(x: any): x is NeedsFoo<number>; // should error
|
||||
~~~~~~
|
||||
!!! error TS2344: Type 'number' does not satisfy the constraint 'Foo'.
|
||||
|
||||
@@ -6,10 +6,10 @@ typeGuardFunctionOfFormThisErrors.ts(24,1): error TS2322: Type '() => this is Fo
|
||||
Property 'lead' is missing in type 'FollowerGuard' but required in type 'LeadGuard'.
|
||||
typeGuardFunctionOfFormThisErrors.ts(26,1): error TS2322: Type '() => this is LeadGuard' is not assignable to type '() => this is FollowerGuard'.
|
||||
Type predicate 'this is LeadGuard' is not assignable to 'this is FollowerGuard'.
|
||||
Type 'LeadGuard' is not assignable to type 'FollowerGuard'.
|
||||
Property 'follow' is missing in type 'LeadGuard' but required in type 'FollowerGuard'.
|
||||
typeGuardFunctionOfFormThisErrors.ts(27,1): error TS2322: Type '() => this is FollowerGuard' is not assignable to type '() => this is LeadGuard'.
|
||||
Type predicate 'this is FollowerGuard' is not assignable to 'this is LeadGuard'.
|
||||
Type 'FollowerGuard' is not assignable to type 'LeadGuard'.
|
||||
Property 'lead' is missing in type 'FollowerGuard' but required in type 'LeadGuard'.
|
||||
typeGuardFunctionOfFormThisErrors.ts(29,32): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
||||
typeGuardFunctionOfFormThisErrors.ts(55,7): error TS2339: Property 'follow' does not exist on type 'RoyalGuard'.
|
||||
typeGuardFunctionOfFormThisErrors.ts(58,7): error TS2339: Property 'lead' does not exist on type 'RoyalGuard'.
|
||||
@@ -55,12 +55,14 @@ typeGuardFunctionOfFormThisErrors.ts(58,7): error TS2339: Property 'lead' does n
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => this is LeadGuard' is not assignable to type '() => this is FollowerGuard'.
|
||||
!!! error TS2322: Type predicate 'this is LeadGuard' is not assignable to 'this is FollowerGuard'.
|
||||
!!! error TS2322: Type 'LeadGuard' is not assignable to type 'FollowerGuard'.
|
||||
!!! error TS2322: Property 'follow' is missing in type 'LeadGuard' but required in type 'FollowerGuard'.
|
||||
!!! related TS2728 typeGuardFunctionOfFormThisErrors.ts:15:5: 'follow' is declared here.
|
||||
a.isLeader = a.isFollower;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => this is FollowerGuard' is not assignable to type '() => this is LeadGuard'.
|
||||
!!! error TS2322: Type predicate 'this is FollowerGuard' is not assignable to 'this is LeadGuard'.
|
||||
!!! error TS2322: Type 'FollowerGuard' is not assignable to type 'LeadGuard'.
|
||||
!!! error TS2322: Property 'lead' is missing in type 'FollowerGuard' but required in type 'LeadGuard'.
|
||||
!!! related TS2728 typeGuardFunctionOfFormThisErrors.ts:11:5: 'lead' is declared here.
|
||||
|
||||
function invalidGuard(c: any): this is number {
|
||||
~~~~
|
||||
|
||||
@@ -7,6 +7,7 @@ typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Gi
|
||||
typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'.
|
||||
Types of property 'f2' are incompatible.
|
||||
Type 'Animal[]' is not assignable to type 'Giraffe[]'.
|
||||
Property 'g' is missing in type 'Animal' but required in type 'Giraffe'.
|
||||
typeMatch2.ts(34,26): error TS2353: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'.
|
||||
typeMatch2.ts(35,5): error TS2741: Property 'y' is missing in type '{ x: number; }' but required in type '{ x: number; y: number; }'.
|
||||
|
||||
@@ -51,6 +52,8 @@ typeMatch2.ts(35,5): error TS2741: Property 'y' is missing in type '{ x: number;
|
||||
!!! error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'.
|
||||
!!! error TS2322: Types of property 'f2' are incompatible.
|
||||
!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'.
|
||||
!!! error TS2322: Property 'g' is missing in type 'Animal' but required in type 'Giraffe'.
|
||||
!!! related TS2728 typeMatch2.ts:10:40: 'g' is declared here.
|
||||
}
|
||||
|
||||
function f4() {
|
||||
|
||||
@@ -15,6 +15,7 @@ typeParamExtendsOtherTypeParam.ts(17,37): error TS2344: Type '{ a: string; }' do
|
||||
typeParamExtendsOtherTypeParam.ts(28,15): error TS2344: Type 'I1' does not satisfy the constraint 'I2'.
|
||||
Property 'b' is missing in type 'I1' but required in type 'I2'.
|
||||
typeParamExtendsOtherTypeParam.ts(29,15): error TS2344: Type 'I1' does not satisfy the constraint 'I2'.
|
||||
Property 'b' is missing in type 'I1' but required in type 'I2'.
|
||||
|
||||
|
||||
==== typeParamExtendsOtherTypeParam.ts (8 errors) ====
|
||||
@@ -77,4 +78,6 @@ typeParamExtendsOtherTypeParam.ts(29,15): error TS2344: Type 'I1' does not satis
|
||||
var x8: B<I2, I1>;
|
||||
~~
|
||||
!!! error TS2344: Type 'I1' does not satisfy the constraint 'I2'.
|
||||
!!! error TS2344: Property 'b' is missing in type 'I1' but required in type 'I2'.
|
||||
!!! related TS2728 typeParamExtendsOtherTypeParam.ts:25:5: 'b' is declared here.
|
||||
|
||||
@@ -2,8 +2,14 @@ typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo<U>' is not assig
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
typeParameterAssignmentCompat1.ts(9,5): error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== typeParameterAssignmentCompat1.ts (4 errors) ====
|
||||
@@ -23,6 +29,9 @@ typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type 'Foo<T>' is not assi
|
||||
return x;
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! related TS2208 typeParameterAssignmentCompat1.ts:5:12: This type parameter might need an `extends U` constraint.
|
||||
}
|
||||
|
||||
class C<T> {
|
||||
@@ -32,8 +41,14 @@ typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type 'Foo<T>' is not assi
|
||||
x = y; // should be an error
|
||||
~
|
||||
!!! error TS2322: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! related TS2208 typeParameterAssignmentCompat1.ts:13:7: This type parameter might need an `extends T` constraint.
|
||||
return x;
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! related TS2208 typeParameterAssignmentCompat1.ts:12:9: This type parameter might need an `extends U` constraint.
|
||||
}
|
||||
}
|
||||
@@ -9,23 +9,69 @@ types.asyncGenerators.es2018.2.ts(10,7): error TS2322: Type '() => AsyncGenerato
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(13,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterableIterator<number>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterableIterator<number>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterableIterator<number>' are incompatible.
|
||||
The types returned by 'next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(16,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterableIterator<number>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterableIterator<number>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterableIterator<number>' are incompatible.
|
||||
The types returned by 'next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(19,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
The types of '[Symbol.asyncIterator]().next' are incompatible between these types.
|
||||
Type '(...args: [] | [undefined]) => Promise<IteratorResult<string, void>>' is not assignable to type '(...args: [] | [undefined]) => Promise<IteratorResult<number, any>>'.
|
||||
The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(22,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterable<number>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(25,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterable<number>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(28,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
The types returned by 'next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(31,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
The types returned by 'next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(34,7): error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
The types returned by 'next(...)' are incompatible between these types.
|
||||
Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(38,11): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(41,12): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
types.asyncGenerators.es2018.2.ts(44,12): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
@@ -73,51 +119,97 @@ types.asyncGenerators.es2018.2.ts(74,12): error TS2504: Type '{}' must have a '[
|
||||
const assignability2: () => AsyncIterableIterator<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterableIterator<number>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterableIterator<number>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterableIterator<number>' are incompatible.
|
||||
!!! error TS2322: The types returned by 'next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* ["a", "b"];
|
||||
};
|
||||
const assignability3: () => AsyncIterableIterator<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterableIterator<number>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterableIterator<number>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterableIterator<number>' are incompatible.
|
||||
!!! error TS2322: The types returned by 'next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* (async function * () { yield "a"; })();
|
||||
};
|
||||
const assignability4: () => AsyncIterable<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
!!! error TS2322: The types of '[Symbol.asyncIterator]().next' are incompatible between these types.
|
||||
!!! error TS2322: Type '(...args: [] | [undefined]) => Promise<IteratorResult<string, void>>' is not assignable to type '(...args: [] | [undefined]) => Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield "a";
|
||||
};
|
||||
const assignability5: () => AsyncIterable<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterable<number>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
!!! error TS2322: The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* ["a", "b"];
|
||||
};
|
||||
const assignability6: () => AsyncIterable<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterable<number>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterable<number>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterable<number>' are incompatible.
|
||||
!!! error TS2322: The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* (async function * () { yield "a"; })();
|
||||
};
|
||||
const assignability7: () => AsyncIterator<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
!!! error TS2322: The types returned by 'next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield "a";
|
||||
};
|
||||
const assignability8: () => AsyncIterator<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
!!! error TS2322: The types returned by 'next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* ["a", "b"];
|
||||
};
|
||||
const assignability9: () => AsyncIterator<number> = async function * () {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '() => AsyncGenerator<string, void, undefined>' is not assignable to type '() => AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Type 'AsyncGenerator<string, void, undefined>' is not assignable to type 'AsyncIterator<number, any, undefined>'.
|
||||
!!! error TS2322: Call signature return types 'AsyncGenerator<string, void, undefined>' and 'AsyncIterator<number, any, undefined>' are incompatible.
|
||||
!!! error TS2322: The types returned by 'next(...)' are incompatible between these types.
|
||||
!!! error TS2322: Type 'Promise<IteratorResult<string, void>>' is not assignable to type 'Promise<IteratorResult<number, any>>'.
|
||||
!!! error TS2322: Type 'IteratorResult<string, void>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
|
||||
!!! error TS2322: Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
yield* (async function * () { yield "a"; })();
|
||||
};
|
||||
async function * explicitReturnType1(): AsyncIterableIterator<number> {
|
||||
|
||||
@@ -6,7 +6,9 @@ unionTypeCallSignatures6.ts(38,4): error TS2349: This expression is not callable
|
||||
unionTypeCallSignatures6.ts(39,1): error TS2684: The 'this' context of type 'A & C & { f0: F0 | F3; f1: F1 | F3; f2: F1 | F4; f3: F3 | F4; f4: F3 | F5; }' is not assignable to method's 'this' of type 'B'.
|
||||
Property 'b' is missing in type 'A & C & { f0: F0 | F3; f1: F1 | F3; f2: F1 | F4; f3: F3 | F4; f4: F3 | F5; }' but required in type 'B'.
|
||||
unionTypeCallSignatures6.ts(48,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'A & B'.
|
||||
Type 'void' is not assignable to type 'A'.
|
||||
unionTypeCallSignatures6.ts(55,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'A & B'.
|
||||
Type 'void' is not assignable to type 'A'.
|
||||
|
||||
|
||||
==== unionTypeCallSignatures6.ts (6 errors) ====
|
||||
@@ -72,6 +74,7 @@ unionTypeCallSignatures6.ts(55,1): error TS2684: The 'this' context of type 'voi
|
||||
f3(); // error
|
||||
~~~~
|
||||
!!! error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'A & B'.
|
||||
!!! error TS2684: Type 'void' is not assignable to type 'A'.
|
||||
|
||||
interface F7 {
|
||||
(this: A & B & C): void;
|
||||
@@ -81,4 +84,5 @@ unionTypeCallSignatures6.ts(55,1): error TS2684: The 'this' context of type 'voi
|
||||
f4(); // error
|
||||
~~~~
|
||||
!!! error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'A & B'.
|
||||
!!! error TS2684: Type 'void' is not assignable to type 'A'.
|
||||
|
||||
@@ -9,13 +9,13 @@ unionTypeErrorMessageTypeRefs01.ts(27,1): error TS2322: Type 'C<Foo>' is not ass
|
||||
Property 'kwah' is missing in type 'Foo' but required in type 'Kwah'.
|
||||
unionTypeErrorMessageTypeRefs01.ts(48,1): error TS2322: Type 'X<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
Type 'X<Foo>' is not assignable to type 'X<Bar>'.
|
||||
Type 'Foo' is not assignable to type 'Bar'.
|
||||
Property 'bar' is missing in type 'Foo' but required in type 'Bar'.
|
||||
unionTypeErrorMessageTypeRefs01.ts(49,1): error TS2322: Type 'Y<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
Type 'Y<Foo>' is not assignable to type 'Y<Baz>'.
|
||||
Type 'Foo' is not assignable to type 'Baz'.
|
||||
Property 'baz' is missing in type 'Foo' but required in type 'Baz'.
|
||||
unionTypeErrorMessageTypeRefs01.ts(50,1): error TS2322: Type 'Z<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
Type 'Z<Foo>' is not assignable to type 'Z<Kwah>'.
|
||||
Type 'Foo' is not assignable to type 'Kwah'.
|
||||
Property 'kwah' is missing in type 'Foo' but required in type 'Kwah'.
|
||||
|
||||
|
||||
==== unionTypeErrorMessageTypeRefs01.ts (6 errors) ====
|
||||
@@ -85,14 +85,17 @@ unionTypeErrorMessageTypeRefs01.ts(50,1): error TS2322: Type 'Z<Foo>' is not ass
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'X<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
!!! error TS2322: Type 'X<Foo>' is not assignable to type 'X<Bar>'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'Bar'.
|
||||
!!! error TS2322: Property 'bar' is missing in type 'Foo' but required in type 'Bar'.
|
||||
!!! related TS2728 unionTypeErrorMessageTypeRefs01.ts:2:17: 'bar' is declared here.
|
||||
thingOfTypeAliases = y;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Y<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
!!! error TS2322: Type 'Y<Foo>' is not assignable to type 'Y<Baz>'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'Baz'.
|
||||
!!! error TS2322: Property 'baz' is missing in type 'Foo' but required in type 'Baz'.
|
||||
!!! related TS2728 unionTypeErrorMessageTypeRefs01.ts:3:17: 'baz' is declared here.
|
||||
thingOfTypeAliases = z;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'Z<Foo>' is not assignable to type 'X<Bar> | Y<Baz> | Z<Kwah>'.
|
||||
!!! error TS2322: Type 'Z<Foo>' is not assignable to type 'Z<Kwah>'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'Kwah'.
|
||||
!!! error TS2322: Property 'kwah' is missing in type 'Foo' but required in type 'Kwah'.
|
||||
!!! related TS2728 unionTypeErrorMessageTypeRefs01.ts:4:18: 'kwah' is declared here.
|
||||
@@ -10,6 +10,9 @@ unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is
|
||||
Type '(Class | Property)[]' is not assignable to type 'Class[]'.
|
||||
Type 'Class | Property' is not assignable to type 'Class'.
|
||||
Type 'Property' is not assignable to type 'Class'.
|
||||
Types of property 'parent' are incompatible.
|
||||
Type 'Module | Class' is not assignable to type 'Namespace'.
|
||||
Property 'members' is missing in type 'Class' but required in type 'Namespace'.
|
||||
|
||||
|
||||
==== unionTypeWithRecursiveSubtypeReduction2.ts (2 errors) ====
|
||||
@@ -48,4 +51,8 @@ unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is
|
||||
!!! error TS2322: Type '(Class | Property)[]' is not assignable to type 'Class[]'.
|
||||
!!! error TS2322: Type 'Class | Property' is not assignable to type 'Class'.
|
||||
!!! error TS2322: Type 'Property' is not assignable to type 'Class'.
|
||||
!!! error TS2322: Types of property 'parent' are incompatible.
|
||||
!!! error TS2322: Type 'Module | Class' is not assignable to type 'Namespace'.
|
||||
!!! error TS2322: Property 'members' is missing in type 'Class' but required in type 'Namespace'.
|
||||
!!! related TS2728 unionTypeWithRecursiveSubtypeReduction2.ts:6:12: 'members' is declared here.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
unionTypesAssignability.ts(18,1): error TS2741: Property 'foo1' is missing in type 'E' but required in type 'D'.
|
||||
unionTypesAssignability.ts(19,1): error TS2322: Type 'D | E' is not assignable to type 'D'.
|
||||
Type 'E' is not assignable to type 'D'.
|
||||
Property 'foo1' is missing in type 'E' but required in type 'D'.
|
||||
unionTypesAssignability.ts(20,1): error TS2741: Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
unionTypesAssignability.ts(22,1): error TS2322: Type 'D | E' is not assignable to type 'E'.
|
||||
Type 'D' is not assignable to type 'E'.
|
||||
Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
unionTypesAssignability.ts(24,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
unionTypesAssignability.ts(25,1): error TS2322: Type 'string | number' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
@@ -13,8 +13,8 @@ unionTypesAssignability.ts(28,1): error TS2322: Type 'string | number' is not as
|
||||
unionTypesAssignability.ts(31,1): error TS2741: Property 'foo1' is missing in type 'C' but required in type 'D'.
|
||||
unionTypesAssignability.ts(32,1): error TS2741: Property 'foo2' is missing in type 'C' but required in type 'E'.
|
||||
unionTypesAssignability.ts(33,1): error TS2322: Type 'C' is not assignable to type 'D | E'.
|
||||
unionTypesAssignability.ts(35,1): error TS2322: Type 'D' is not assignable to type 'E'.
|
||||
unionTypesAssignability.ts(37,1): error TS2322: Type 'E' is not assignable to type 'D'.
|
||||
unionTypesAssignability.ts(35,1): error TS2741: Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
unionTypesAssignability.ts(37,1): error TS2741: Property 'foo1' is missing in type 'E' but required in type 'D'.
|
||||
unionTypesAssignability.ts(41,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
unionTypesAssignability.ts(43,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
unionTypesAssignability.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
@@ -52,7 +52,8 @@ unionTypesAssignability.ts(71,5): error TS2322: Type 'T | U' is not assignable t
|
||||
d = unionDE; // error e is not assignable to d
|
||||
~
|
||||
!!! error TS2322: Type 'D | E' is not assignable to type 'D'.
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'D'.
|
||||
!!! error TS2322: Property 'foo1' is missing in type 'E' but required in type 'D'.
|
||||
!!! related TS2728 unionTypesAssignability.ts:3:21: 'foo1' is declared here.
|
||||
e = d;
|
||||
~
|
||||
!!! error TS2741: Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
@@ -61,7 +62,8 @@ unionTypesAssignability.ts(71,5): error TS2322: Type 'T | U' is not assignable t
|
||||
e = unionDE; // error d is not assignable to e
|
||||
~
|
||||
!!! error TS2322: Type 'D | E' is not assignable to type 'E'.
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'E'.
|
||||
!!! error TS2322: Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
!!! related TS2728 unionTypesAssignability.ts:4:21: 'foo2' is declared here.
|
||||
num = num;
|
||||
num = str;
|
||||
~~~
|
||||
@@ -94,11 +96,13 @@ unionTypesAssignability.ts(71,5): error TS2322: Type 'T | U' is not assignable t
|
||||
d = d;
|
||||
e = d;
|
||||
~
|
||||
!!! error TS2322: Type 'D' is not assignable to type 'E'.
|
||||
!!! error TS2741: Property 'foo2' is missing in type 'D' but required in type 'E'.
|
||||
!!! related TS2728 unionTypesAssignability.ts:4:21: 'foo2' is declared here.
|
||||
unionDE = d; // ok
|
||||
d = e;
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'D'.
|
||||
!!! error TS2741: Property 'foo1' is missing in type 'E' but required in type 'D'.
|
||||
!!! related TS2728 unionTypesAssignability.ts:3:21: 'foo1' is declared here.
|
||||
e = e;
|
||||
unionDE = e; // ok
|
||||
num = num;
|
||||
|
||||
@@ -63,7 +63,7 @@ varianceAnnotations.ts(160,68): error TS2345: Argument of type 'ActionObject<{ t
|
||||
Type 'StateNode<any, { type: "PLAY"; value: number; } | { type: "RESET"; }>' is not assignable to type 'StateNode<any, { type: "PLAY"; value: number; }>'.
|
||||
Types of property '_storedEvent' are incompatible.
|
||||
Type '{ type: "PLAY"; value: number; } | { type: "RESET"; }' is not assignable to type '{ type: "PLAY"; value: number; }'.
|
||||
Type '{ type: "RESET"; }' is not assignable to type '{ type: "PLAY"; value: number; }'.
|
||||
Property 'value' is missing in type '{ type: "RESET"; }' but required in type '{ type: "PLAY"; value: number; }'.
|
||||
|
||||
|
||||
==== varianceAnnotations.ts (31 errors) ====
|
||||
@@ -323,7 +323,8 @@ varianceAnnotations.ts(160,68): error TS2345: Argument of type 'ActionObject<{ t
|
||||
!!! error TS2345: Type 'StateNode<any, { type: "PLAY"; value: number; } | { type: "RESET"; }>' is not assignable to type 'StateNode<any, { type: "PLAY"; value: number; }>'.
|
||||
!!! error TS2345: Types of property '_storedEvent' are incompatible.
|
||||
!!! error TS2345: Type '{ type: "PLAY"; value: number; } | { type: "RESET"; }' is not assignable to type '{ type: "PLAY"; value: number; }'.
|
||||
!!! error TS2345: Type '{ type: "RESET"; }' is not assignable to type '{ type: "PLAY"; value: number; }'.
|
||||
!!! error TS2345: Property 'value' is missing in type '{ type: "RESET"; }' but required in type '{ type: "PLAY"; value: number; }'.
|
||||
!!! related TS2728 varianceAnnotations.ts:158:48: 'value' is declared here.
|
||||
|
||||
// Repros from #48618
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// @strict: true
|
||||
// @target: es2020
|
||||
// @noEmit: true
|
||||
|
||||
// Example: different error code altogether
|
||||
|
||||
interface ThroughStream {
|
||||
a: string;
|
||||
}
|
||||
interface ReadStream {
|
||||
f: string;
|
||||
g: number;
|
||||
h: boolean;
|
||||
i: BigInt;
|
||||
j: symbol;
|
||||
}
|
||||
function foo(): ReadStream {
|
||||
return undefined as any as ThroughStream;
|
||||
}
|
||||
function bar(): ReadStream {
|
||||
return undefined as any as ThroughStream;
|
||||
}
|
||||
|
||||
// Example: different elaboration
|
||||
|
||||
type Wrap = {
|
||||
someProp: Bar<number>;
|
||||
}
|
||||
type OtherWrap = {
|
||||
someProp: Foo<string>;
|
||||
}
|
||||
type Foo<T> = {
|
||||
foo: { what: T };
|
||||
}
|
||||
type Bar<T> = {
|
||||
foo: { what: T };
|
||||
} | boolean;
|
||||
|
||||
function fun(param: Wrap): void {}
|
||||
|
||||
declare let fooStr: Foo<string>;
|
||||
declare let otherWrap: OtherWrap;
|
||||
|
||||
let a: Bar<number> = fooStr;
|
||||
|
||||
fun(otherWrap);
|
||||
Reference in new issue
Block a user