Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Wrong type interence with objects #60

Closed
mikhailKilin opened this issue Apr 9, 2020 · 1 comment
Closed

Wrong type interence with objects #60

mikhailKilin opened this issue Apr 9, 2020 · 1 comment

Comments

@mikhailKilin
Copy link

good interence:
cosnt fn = (a, b) => a + b;
const res = fn(1, 2) //type is number

bad inference:
const fn = (a) => a.a + a.b;
const res = fn({a: 1, b: 2}) // type is number | string | bigint, but it can be just a number

@JSMonk
Copy link
Owner

JSMonk commented Apr 12, 2020

Thank you for contribution ^_^

@JSMonk JSMonk closed this as completed Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants