Skip to content

GenType: mutually recursive types inside module fails to reference type by flattened alias #6526

Closed
@JonoPrest

Description

@JonoPrest

Hi there,

I've found a bug with genType that can be reproduced as follows:

module MyModule = {
  @genType
  type rec a = {fieldB: b}
  @genType and b = {fieldA: a}
}

produces:

// tslint:disable-next-line:interface-over-type-literal
export type MyModule_a = { readonly fieldB: b };

// tslint:disable-next-line:interface-over-type-literal
export type MyModule_b = { readonly fieldA: MyModule_a };

As you can see fieldB references b and not MyModule_b

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