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

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

Closed
adrianoc opened this issue Aug 2, 2023 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@adrianoc
Copy link
Owner

adrianoc commented Aug 2, 2023

  • 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) {}
}
@adrianoc adrianoc added 🐛 bug Something isn't working 🎃 good first issue Good for newcomers labels Aug 2, 2023
adrianoc added a commit that referenced this issue Aug 16, 2023
…odDefinitions (#245)

this was happening due a mismatch between the registering of the variable used to store the
MethodDefinition object and the query used to retrieve it back when processing references
to such method.
@adrianoc adrianoc added fixed-in-dev-branch and removed 🎃 good first issue Good for newcomers labels Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant