Skip to content

Signature file generation does not handle attributes on nested modules #13758

@nojaf

Description

@nojaf

When generating a signature file from a nested module with attributes, the generated code does not contain any attributes for the nested module.

Repro steps

namespace MyApp.Types

[<RequireQualifiedAccess>]
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
module Area =
    type Meh =  class end

leads to

namespace MyApp.Types
    
    module Area =
        
        [<Class>]
        type Meh =
            class end

Expected behaviour

The generated signature should be considered equivalent to the backing source file.

Actual behaviour

The generated code isn't valid, error in implementation:

image

It only complains about CompilationRepresentation - RequireQualifiedAccess does not to be there
The same thing happens with eg. AutoOpen causing unresolved symbol references in other modules.

Known workarounds

Edit signature file by hand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions