Repro steps
- Compile following code with
--sig option and generate signature file.
module rec Library1
[<Struct>]
type A = A of B
[<Struct>]
type B = B
- 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:
- replace
and to type for type B
- 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