-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.6.1 (2.7.0-dev.20171102)
Code
type Nominal<Kind extends string, Type> = Type & {
[Symbol.species]: Kind;
};
type A = Nominal<'A', string>;
declare const a: Set<A>;
declare const b: Set<A>;
const c1 = Array.from(a).concat(Array.from(b)); // Argument of type 'string[]' is not assignable to parameter of type 'Nominal<"A", string> | ReadonlyArray<Nominal<"A", string>>'.
const c2 = Array.from(a).concat(Array.from<A>(b)); // OK
const aa = Array.from(a);
const bb = Array.from(b);
const cc = aa.concat(bb); // OK
Expected behavior:
No errors.
Actual behavior:
With Array.from(a).concat(Array.from(b))
we have an error Argument of type 'string[]' is not assignable to parameter of type 'Nominal<"A", string> | ReadonlyArray<Nominal<"A", string>>'.
In 2.5.3 it works fine.
aluanhaddad and Nipheris
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue