Skip to content

Type mis-match in destructuring of @optional field #5472

Closed
@mununki

Description

@mununki

This is related #5423 #5452

type t0 = {@optional x: int}
let f0: t0 = {x: 1} // x: option<int>
let {x} = f0 // x: int instead option<int>

I think there's a type mis-match after destructuring. Isn't it correct that type of x is option<int>?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions