-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Disable constraint reduction in intersections created by constraint hoisting #58403
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
Conversation
@typescript-bot test it |
Hey @ahejlsberg, the results of running the DT tests are ready. Everything looks the same! |
@ahejlsberg Here are the results of running the user tests comparing Everything looks good! |
@ahejlsberg Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@ahejlsberg Here are the results of running the top 400 repos comparing Everything looks good! |
Tests and performance all look good. This is ready to review and merge. |
@@ -17467,7 +17468,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
// a type alias of the form "type List<T> = T & { next: List<T> }" cannot be reduced during its declaration. | |||
// Also, unlike union types, the order of the constituent types is preserved in order that overload resolution | |||
// for intersections of types with signatures can be deterministic. | |||
function getIntersectionType(types: readonly Type[], aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[], noSupertypeReduction?: boolean): Type { | |||
function getIntersectionType(types: readonly Type[], flags = IntersectionFlags.None, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this flag something that should be required, in case we forget to pass it? Happens all the time for the relation intersection state...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's exceedingly rare to need any of these flags (only one place for each flag in entire code base), so I think it's preferable to leave it optional.
Fixes #58370.