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

Under-constrained mapped type key #9259

Open
hurrymaplelad opened this issue Feb 25, 2025 · 0 comments
Open

Under-constrained mapped type key #9259

hurrymaplelad opened this issue Feb 25, 2025 · 0 comments

Comments

@hurrymaplelad
Copy link
Contributor

hurrymaplelad commented Feb 25, 2025

Flow version: v0.261.2 & TryFlow master

type Definitions = $ReadOnly<{
    [string]: $ReadOnly<{...}>,
}>;

type Mapped = $ReadOnly<{
    [K in keyof Definitions]: component(
        ...Definitions[K] // Boom! Flow doesn't like this lookup
    ),
}>;

Expected behavior

Type mapping works

Actual behavior

Cannot access KonDefinitions because mixed [1] is incompatible with string [2]. [incompatible-type]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant