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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We consider any intersection A & B assignable to a type T if either A or B is assignable to T. This can be problematic when T is an object type with optional properties. For example:
The issue here is that because { b: string } is assignable to { a?: number, b: string } we also consider any intersection that includes { b: string } to be assignable--even if the intersection includes another type that conflicts with the optional a property.
With this PR we now require intersections of object types as a whole to be assignable to the target type. In other words, we treat { a: null } & { b: string} identically to { a: null, b: string } in relationships.
@weswigham Can you take a look at the last user test suite run and tell me which of those are preexisting conditions, or how I might find out? The office-ui-fabric-react is for sure a new issue, but I don't know about the rest.
Can you take a look at the last user test suite run and tell me which of those are preexisting conditions, or how I might find out? The office-ui-fabric-react is for sure a new issue, but I don't know about the rest.
Looking over #37219 and #37203 , looks like just the office-ui-fabric-react ones are new.
Summarizing test runs: No change in RWC and DT and no appreciable perf impact. New errors in the office-ui-fabric-react user test project are indeed legitimate errors that we didn't catch before.
So, this PR is technically a breaking change because we find new issues.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We consider any intersection
A & Bassignable to a typeTif eitherAorBis assignable toT. This can be problematic whenTis an object type with optional properties. For example:The issue here is that because
{ b: string }is assignable to{ a?: number, b: string }we also consider any intersection that includes{ b: string }to be assignable--even if the intersection includes another type that conflicts with the optionalaproperty.With this PR we now require intersections of object types as a whole to be assignable to the target type. In other words, we treat
{ a: null } & { b: string}identically to{ a: null, b: string }in relationships.Fixes #36604.