-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
cool-exampleSomething very interesting to look atSomething very interesting to look at
Description
const add = x => y => x + y;
const a = add(1)(2);
const b = add('a')('b');
const c = add(1)('b');
a - 1;Expected results:
- Trigger an error on the
add('a')call since that string value doesn't match thenumbertype that was implied by the previousadd(1)call. Ditto for the('b')call. These errors could be configured off if you didn't want them. - Expand the implied type for the
xfunction parameter to be a union type (number | string), as well asy, so future calls can send either type for either parameter. - Trigger an error on the
+operation when the1and'b'are added. Again, this error could be configured off. a - 1would definitely be allowed, sinceawas implied as anumber.
Other results:
sh4hids
Metadata
Metadata
Assignees
Labels
cool-exampleSomething very interesting to look atSomething very interesting to look at