Skip to content

F# compiler allows exception type names to contain reserved characters #18763

@Windows10CE

Description

@Windows10CE

The exception syntax allows type identifiers that contain characters that should be banned by

let IllegalCharactersInTypeAndNamespaceNames =
[| '.'; '+'; '$'; '&'; '['; ']'; '/'; '\\'; '*'; '\"'; '`' |]

Repro steps

exception ``Te`.+$/\"st&*[]``

Expected behavior

This provides an error, same as other syntax kinds for declaring types that will appear in the metadata

Actual behavior

Compiles and emits a type with the name Te`.+$/"st&*[]

Known workarounds

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions