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
This is an effect of #30637, a known breaking change. In your example we make no inferences for the Props type parameter in the call to createStyles. This means we default to unknown, but since that doesn't satisfy the constraint object, we pick object. Previously we'd default to {} which did satisfy the constraint.
TypeScript Version: typescript@3.6.0-dev.20190603
Search Terms:
3.5, infer
Code
Expected behavior:
Behavior in 3.4.5
typeof styles = Styles<'root', {}>
Actual behavior:
Behavior in >=3.5.0
typeof styles = Styles<'root', object>
Playground Link:
playground
Related Issues: Did not find any
Notes:
Seems like the playground is still using 3.4.
Usage of this behavior is showcased in https://github.com/eps1lon/ts-inference-3.5/blob/master/index.ts with a fix for 3.5.
The text was updated successfully, but these errors were encountered: