Skip to content

Cannot instantiate variant with inline record that has optional fields #5824

Closed
@tsnobip

Description

@tsnobip

I've noticed you can define a variant with an inline record that optional fields, but you can't instantiate it.

Example:

// this compiles
type foo = Foo({name: string, age?: int})

// Error: Some record fields are undefined: age
let foo = Foo({name: "foo"}) 

We should either forbid the creation of such a type or allow to instantiate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions