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
I tried to explain {..} to another user and while typing out some examples I created a code snippet that actually compiled (even though I think shouldn't):
IMO either it should have yielded a type error on the second name assignment, or at least error out in the myFn(someObj) call, since I'd expect someObj["name"] to be of type int.
Is this intentional?
The text was updated successfully, but these errors were encountered:
I think this is intentional. {..} is a concrete type, right? So assigning a property to it doesn't refine it (compared to Typescript for example). I've used this to quickly port JS code to non-idiomatic ReScript.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I tried to explain
{..}
to another user and while typing out some examples I created a code snippet that actually compiled (even though I think shouldn't):IMO either it should have yielded a type error on the second
name
assignment, or at least error out in themyFn(someObj)
call, since I'd expectsomeObj["name"]
to be of typeint
.Is this intentional?
The text was updated successfully, but these errors were encountered: