Skip to content

c#: Resource and method with same name #1232

@MendyBerger

Description

@MendyBerger

Componentize generates invalid code in cases where a resource and it's method share the same name.

E.G.

resource foo {
  foo: func();
}

Results in the following error:

Restore complete (0.5s)
  dotnet_counter failed with 1 error(s) (2.1s)
    [path]/obj/Release/net9.0/wasi-wasm/wit_bindgen/BrowserWorld.wit.imports.webidl.browser.IGlobal.cs(205513,30): error CS0542: 'Foo': member names cannot be the same as their enclosing type

Build failed with 1 error(s) in 2.9s

Metadata

Metadata

Assignees

No one assigned

    Labels

    gen-c#Related to the C# code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions