Skip to content

Why the type system does not support the use of property to select subtypes? #18881

Closed
@xiaocaibird

Description

@xiaocaibird

Only support to use of "index".

type t = {
     a: {
        c: string
    },
    b: string
}

type a1 = t.a;  //error
type a2 = t['a'];  //ok

I must operate many times when I want rename "t['a']".
How to make it more convenient?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions