You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commonMethodDifferentReturnType: (a, b) => strOrNumber,
117
117
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118
118
!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '((a: string, b: number) => string) | ((a: string, b: number) => number)'.
119
-
!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'.
120
-
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
121
-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
119
+
!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => string'.
120
+
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
121
+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
122
122
!!! related TS6500 tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts:35:5: The expected type comes from property 'commonMethodDifferentReturnType' which is declared here on type 'I11 | I21'
Copy file name to clipboardExpand all lines: tests/baselines/reference/errorsWithCallablesInUnions01.errors.txt
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
tests/cases/compiler/errorsWithCallablesInUnions01.ts(10,12): error TS2322: Type '(x: string) => void' is not assignable to type 'IDirectiveLinkFn<number> | IDirectivePrePost<number>'.
2
-
Type '(x: string) => void' has no properties in common with type 'IDirectivePrePost<number>'.
2
+
Type '(x: string) => void' is not assignable to type 'IDirectiveLinkFn<number>'.
3
+
Types of parameters 'x' and 'scope' are incompatible.
Copy file name to clipboardExpand all lines: tests/baselines/reference/functionExpressionContextualTyping2.errors.txt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'.
2
-
Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'.
3
-
Type 'boolean' is not assignable to type 'string'.
2
+
Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => number'.
3
+
Type 'boolean' is not assignable to type 'number'.
!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'.
20
-
!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'.
21
-
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
20
+
!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => number'.
21
+
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
0 commit comments