[1.3.*] Types of parameters '__0' and 'value' are incompatible.
See original GitHub issueBug Report
- [x] bug report
- [ ] feature request
Versions.
@typescript: 2.4.2
@rxjs: 5.4.3
@angular/cli: 1.3.1
node: 8.0.0
os: linux x64
@angular/animations: 4.3.4
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.4
@angular/compiler: 4.3.4
@angular/core: 4.3.4
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.3.4
@angular/http: 4.3.4
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.4
@angular/platform-browser-dynamic: 4.3.4
@angular/router: 4.3.4
@angular/cli: 1.3.1
@angular/compiler-cli: 4.3.4
Repro steps.
let s: string = 'abc',
b: boolean = true,
n: number = 10;
Observable.forkJoin([Observable.of(s), Observable.of(b), Observable.of(n)])
.map(([s, b, n]: [string, boolean, number]) => s);
The log given by the failure.
ERROR in file.ts (6,18): Argument of type '([s, b, n]: [string, boolean, number]) => string' is not assignable to parameter of type '(value: boolean[], index: number) => string'.
Types of parameters '__0' and 'value' are incompatible.
Type 'boolean[]' is not assignable to type '[string, boolean, number]'.
Property '0' is missing in type 'boolean[]'.
Desired functionality.
This code gets compiled on v1.2.7 but fails on v1.3.*
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
is "Types of parameters '__0' and 'value' are incompatible" a ...
This causes an error because your function is explicit about accepting a the tuple type [any] . An array type is not assignable...
Read more >Documentation - Type Compatibility - TypeScript
Type compatibility in TypeScript is based on structural subtyping. ... Enum values from different enum types are considered incompatible. For example,.
Read more >Chapter 4. Types, Values, and Variables - Oracle Help Center
A NaN value is used to represent the result of certain invalid operations such as dividing zero by zero. NaN constants of both...
Read more >Semantics
Variables can be defined using either their type (like String ) or by using the keyword def (or var ) followed by a...
Read more >Function has a parameter whose default value is incompatible ...
Function has a parameter whose default value is incompatible with its declared type: false positive for iterable type ... This seems to apply...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @clydin. There are 3 working examples that get compiled under angular-cli 1.3.1 and TS 2.4:
@clydin Could you please provide some reference that
forkJoin doesn't work with a multi-type array in TS 2.4
? Is it by design? What would be a solution in this case? In this example forkJoin accepts observables of multiple types. I removed all the type casts from my previous code but I’m gettingERROR in file.ts (5,38): Argument of type 'string' is not assignable to parameter of type 'number'.
: