Skip to content

Under-constrained mapped type key #9259

Open
@hurrymaplelad

Description

@hurrymaplelad

Flow version: v0.261.2 & TryFlow master

type Definitions = $ReadOnly<{
    a: {type: 'a'},
    b: {type: 'b'}
}>;

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]

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions