Skip to content

Usage of an inline operator overload in a member function causes FS1114 with FSC 11 #21016

Closed

Description

@sakarikapanen-kalmar

Usage of an inline operator overload in a member function causes FS1114 with FSC 11.

Repro steps

Minimal repro:

type X(y: int) =
    member x.Y = y
    static member inline (*) ((a: int), (b: X)) = X(a * b.Y)
    member x.multiply (a: int) = a * x

Running this with dotnet fsi emits the error:

test.fsx(4,34): error FS1114: The value 'FSI_0001.X.(*)' was marked inline but was not bound in the optimization environment

This is with .NET SDK 11.0.100. If the SDK is overridden to 10.0.404, dotnet fsi does not emit this error.

Known workarounds

If X.multiply is moved to a standalone function, no error is emitted. E.g. this builds:

type X(y: int) =
    member x.Y = y
    static member inline (*) ((a: int), (b: X)) = X(a * b.Y)

module X =
    let multiply (a: int) (b: X) = a * b

Removing the inline attribute from the operator overload from the repro code makes the build pass as well.

Related information

This was spotted outside of dotnet fsi usage, in application code. This is just a minimal reproducer of the problem.

Activity

  1. added this to the Backlog milestone on Nov 23, 2026
  2. abonie commented on Nov 23, 2026

    @abonie
    Member

    Bisect points to #20111 as a likely culprit, @majocha do you have time to take a look?

  3. majocha commented on Nov 23, 2026

    @majocha
    Contributor

    Yes, I'll try to post a fix.

  4. added a commit that references this issue on Nov 23, 2026
    0f36899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions