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
* The expected type is not assignable to the argument type, but the argument type is
37
37
* assignable to the expected type. This means our type is too wide.
38
38
*/
39
39
diagnostics.push(makeDiagnostic(node,`Parameter type \`${checker.typeToString(expectedType)}\` is declared too wide for argument type \`${checker.typeToString(argumentType)}\`.`));
* The expected type and argument type are assignable in both directions. We still have to check
43
+
* if the types are identical. See https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.11.2.
44
+
*/
45
+
diagnostics.push(makeDiagnostic(node,`Parameter type \`${checker.typeToString(expectedType)}\` is not identical to argument type \`${checker.typeToString(argumentType)}\`.`));
Copy file name to clipboardExpand all lines: source/test/test.ts
+3-1
Original file line number
Diff line number
Diff line change
@@ -237,7 +237,9 @@ test('loose types', async t => {
237
237
[14,0,'error','Parameter type `Promise<string | number>` is declared too wide for argument type `Promise<number>`.'],
238
238
[16,0,'error','Parameter type `Observable<string | number>` is declared too wide for argument type `Observable<string>`.'],
239
239
[20,0,'error','Parameter type `Observable<string | number> | Observable<string | number | boolean>` is declared too wide for argument type `Observable<string | number> | Observable<string>`.'],
240
-
[28,0,'error','Parameter type `Foo<string | Foo<string | number>> | Foo<Date> | Foo<Symbol>` is declared too wide for argument type `Foo<Date> | Foo<Symbol> | Foo<string | Foo<number>>`.']
240
+
[28,0,'error','Parameter type `Foo<string | Foo<string | number>> | Foo<Date> | Foo<Symbol>` is declared too wide for argument type `Foo<Date> | Foo<Symbol> | Foo<string | Foo<number>>`.'],
241
+
[32,0,'error','Parameter type `string | number` is not identical to argument type `any`.'],
242
+
[34,0,'error','Parameter type `Observable<string | number> | Observable<any> | Observable<string | number | boolean>` is not identical to argument type `Observable<string | number> | Observable<string> | Observable<string | number | boolean>`.']
0 commit comments