Skip to content

"Special" intersections (such as string & {}) are no longer order-independent since 4.8Β #53043

Closed
@Andarist

Description

@Andarist

Bug Report

πŸ”Ž Search Terms

string autocomplete catch all intersection special

πŸ•— Version & Regression Information

  • This changed between versions 4.7 and 4.8

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare function a(arg: 'test' | (string & {})): void
a('') // try string completions here
declare function b(arg: 'test' | ({} & string)): void
b('') // try string completions here

πŸ™ Actual behavior

Since 4.8 the second function doesn't provide completions despite using an intersection with the same members as the first one.

πŸ™‚ Expected behavior

I would expect both to behave the same, regardless of the order of the intersection members.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Experimentation NeededSomeone needs to try this out to see what happensSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions