Skip to content

Methods taking nullable reference types as parameters generates two MethodDefinitions #245

@adrianoc

Description

@adrianoc
  • One of the MethodDefinitions is never added to the type
  • References to such method are incorrectly pointing to the the wrong one.
  • The problem happens when we register the variable used in the generated code to store the reference to the MethodDefinition. For some reason, the parameter types does not include the information that they are nullable

Snippet to reproduce the issue (note in the generated code that there are to MethodDefinitions for M(object?):

class Foo
{
	void M2() { M(this); }
	void M(object?  o) {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions