Skip to content

Obsolete attribute warning/error is not taken into account when used with a unit of measure #18181

@edgarfgp

Description

@edgarfgp

Please provide a succinct description of the issue.

Repro steps

Consider the following code:

open System
[<Measure; Obsolete("Use cm2")>]
type cm

let myCm = 3<cm> // cm should warn/error as obsolete

[<Measure>] type ml = cm^3 // cm should warn/error as obsolete


[<Measure; Obsolete("Use kg2")>]
type kg

[<Measure>] type m

[<Measure; Obsolete("Use s2")>]
type s

// Force, Newtons.
[<Measure>] type N = kg m / s^2 //  // `kg` and `s` should warn/error as obsolete

If possible attach a zip file with the repro case. This often makes it easier for others to reproduce.
The zip file should ideally represent the situation just before the call/step that is problematic.

Expected behavior

Warning/Error should be shown when using obsolete UOM

Actual behavior

No Warning/Error are shown when using obsolete UOM

Provide a description of the actual behaviour observed.

Known workarounds

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions