Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 3/6/2020 #37388

Closed
DanielRosenwasser opened this issue Mar 13, 2020 · 0 comments
Closed

Design Meeting Notes, 3/6/2020 #37388

DanielRosenwasser opened this issue Mar 13, 2020 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

Assignability Between {} and Unconstrained Type Parameters

#33570

  • When we added unknown, we also added a special case for unknown to be assignable to {} and Object.
  • A while back, we changed the default type parameter constraint of {} to unknown
  • This actually broke us as well!
    • A couple of places where we mixed and matched between {} and unknown.
  • Lots of failures, but mostly failures in the same package.
    • schema<T> where T really should've been updated to {}.
  • Does this break type parameters that explicitly extend {}?
    • No, there's no special casing for type parameters.
  • Is it pretty easy to fix?
    • Pretty consistent that people just have to change the constraints to only accept {} or object.
  • Not such a big fan of more breaks in the same release.
    • But the error messages are consistent around {}.
  • What about when you're not in strict mode?
    • There, unknown and {} are really the same thing.
    • Maybe that's why we kept the rule in the first place.
    • unknown is already assignable to {} outside of strictNullChecks, so this doesn't affect users there.
  • Who'd it break?
    • DefinitelyTyped
    • Office UI Fabric
      • Seems to be from DefinitelyTyped changes
  • Conclusion
    • Try to see whether we can at least give an actionable error on this change.
    • Let's hold it off for another release.

Update on Intersection Assignability with Optional Properties

#37195

  • Office UI Fabric got hit, gave them an update.

Checking Index Signatures In the Presence of Optional Properties

#27591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

2 participants