Skip to content

js_dump.ml build error when using String(string) variant in untagged union with other tag #6495

Closed as not planned
@ryyppy

Description

@ryyppy

Version: 11.0.0-rc.6

Create a file Foo.res with the following content:

@unboxed
type href = String(string) | Number(int)

// This works
let href = Number(1);

/**
This doesn't compile.

Fatal error: exception File "jscomp/core/js_dump.ml", line 828, characters 29-35: Assertion failed
FAILED: cannot make progress due to previous errors.
*/
let href2 = String("test");

Some observations:

  • The issue doesn't appear to be coupled to String(). If I define a type Number(int) | Object({foo: string}), the same issue is observed
  • The example above will actually compile correctly in the playground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleOld issues that went stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions