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

Autocomplete doesn't work with some intersection/union types #1242

Open
grilme99 opened this issue Apr 27, 2024 · 0 comments
Open

Autocomplete doesn't work with some intersection/union types #1242

grilme99 opened this issue Apr 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@grilme99
Copy link

I'm not sure about terminology or what exactly is causing this, but there are some edge cases around intersections and/or unions that cause autocomplete to break. Below is a minimal repro, but this bug is notably affecting React prop autocomplete as well as various other parts of our codebases.

In this sample, flex and flexBasis will not autocomplete inside of style.

type ViewStyle = {
    flex: number,
    flexBasis: number,
}

type RecursiveArray<T> = { T | RecursiveArray<T> }
export type StyleProp<T> = T | RecursiveArray<T>

export type ViewProps = {
    style: StyleProp<ViewStyle>?,
}

local _props: ViewProps = {
    style = {
        
    }
}

The type of ViewProps is:

type ViewProps = {|
    style: (t1 | {|
        flex: number,
        flexBasis: number
    |})?
|} where t1 = {t1 | {|
    flex: number,
    flexBasis: number
|}}
@grilme99 grilme99 added the bug Something isn't working label Apr 27, 2024
@aatxe aatxe self-assigned this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants