Skip to content

inline operator not working #18561

Open
Open
@ingted

Description

@ingted

Please provide a succinct description of the issue.

Repro steps

Provide the steps required to reproduce the problem:

let inline (!?>)< 'a when 'a : (static member i : int) and 'a : comparison> () : int = 'a.i
let inline U< 'a when 'a : (static member i : int)> () : int = 'a.i

type Foo () =
    static member i = 42

U<Foo>()
(!?>) <Foo>()

Expected behavior

(!?>) () should get same result with U()

Actual behavior

However it give us

linqExpTest.fsx(61,2): error FS0001: The type '(unit -> int)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

Known workarounds

None.

Related information

Provide any related information (optional):

  • Operating system: Windows Server 2019
  • .NET Runtime: .NET 9.0.103
  • Editing Tools: Visual Studio 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingArea-Compiler-SRTPbugs in SRTP inference, resolution, witness passing, code genBugNeeds-Triage

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions