Skip to content

When "module rec" is used, a file that can not be compiled is output by --sig option #2685

@hafuu

Description

@hafuu

Repro steps

  1. Compile following code with --sig option and generate signature file.
module rec Library1

[<Struct>]
type A = A of B

[<Struct>]
type B = B
  1. Add the generated signature file to project.

Expected behavior

It generates the compilable signature.

Actual behavior

A compile error occurs: Unexpected keyword 'and' in signature file.

module Library1
[<StructAttribute ()>]
type A = | A of B
[<StructAttribute ()>]
and B = | B

Known workarounds

Edit the generated signature file manually as follows:

  1. replace and to type for type B
  2. add rec keyword after module keyword
module rec Library1
[<StructAttribute ()>]
type A = | A of B
[<StructAttribute ()>]
type B = | B

Related information

Windows, Visual Studio 2017, F# 4.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions