Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile static abstract member functions with byref parameters #18135

Open
nodakai opened this issue Dec 13, 2024 · 0 comments
Open

Can't compile static abstract member functions with byref parameters #18135

nodakai opened this issue Dec 13, 2024 · 0 comments
Labels
Area-Compiler-CodeGen IlxGen, ilwrite and things at the backend Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@nodakai
Copy link

nodakai commented Dec 13, 2024

FSC : error FS2014: A problem occurred writing the binary 'obj/Debug/net9.0/refint/Sandbox0.dll': Error in pass3 for type Program, error: Error in pass3 for type T, error: Error in GetMethodRefAsMethodDefIdx for mref = ("Program.I.Foo", "T"), error: MethodDefNotFound

Repro steps

[<Interface>]
type I =
  static abstract Foo: int inref -> int

type T =
  interface I with
    static member Foo i = i

let f<'T when 'T :> I>()  =
  let x = 123
  printfn "%d" ('T.Foo &x)

f<T>()

Expected behavior

This should compile fine

Actual behavior

Weird error quoted above

Known workarounds

Replace byref parameters with Span<T>

Related information

dotnet --version
9.0.100
@github-actions github-actions bot added this to the Backlog milestone Dec 13, 2024
@0101 0101 added Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. Area-Compiler-CodeGen IlxGen, ilwrite and things at the backend and removed Needs-Triage labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-CodeGen IlxGen, ilwrite and things at the backend Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

2 participants