Skip to content

Signature printing doesn't escape all identifiers correctly #12094

@dsyme

Description

@dsyme

There are some subtle cases in signature printing (and thus quick info displays and signature file generation) with escaping identifiers. Some test cases are shown below, here all should be escaped using ``...``except the three indicated.

In the case of ``+`` for example, the compiled IL name is + (not op_Addition) but we are currently showing the value as (+), i.e. as if it had been defined let (+) = .... That is wrong

In the case of base we take into account that the value is not a proper base value, and hence needs escaping (can't be referred to via the keyword base).

let ``A.B``   = true;;
let ``+``   = true;;
let ``..``   = true;;
let ``.. ..``   = true;;
let ``(+)``   = true;;
let ``land``   = true;;
let ``type``   = true;;
let ``or``   = true;;
let ``params``   = true;;
let ``A``   = true;; // NO
let ``'A``   = true;;
let ``A'``   = true;;   // NO
let ``0A``   = true;;
let ``A0``   = true;;  // NO
let ``A-B``   = true;;
let ``A B``   = true;;
let ``base``   = true;;
let ``or``   = true;;

Will be fixed by #12072

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