Skip to content

"Edit Method" does not work for most recent Unity games due to weird generics(?) syntax #460

@BlueRaja

Description

@BlueRaja

dnSpyEx version

6.5.1

Describe the Bug

For more and more games recently, the "Edit Method" feature does not work. When attempting to edit a method, I will get compiler errors in other parts of the class. The offending decompiled code usually looks something like this:

// Token: 0x06000F6F RID: 3951 RVA: 0x0004A7F9 File Offset: 0x000489F9
[global::System.Runtime.CompilerServices.CompilerGenerated]
private void <Respawn>g__SetFacingForSpawnPoint|968_0(ref global::HeroController.<>c__DisplayClass968_0)
{
}

I'm not sure what this <Respawn> before the method name, or |968_0 after the method name means, and the compiler doesn't seem to like it either.

How To Reproduce

The above example comes from Silksong's HeroController class.

Expected Behavior

"Edit Method" compiles as expected

Actual Behavior

Compiler errors with no code edited.

Additional Context

Workaround: need to edit code raw IL ☹️

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions