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

Provide instance reference for constructor calls. #528

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

safesparrow
Copy link

@safesparrow safesparrow commented Mar 11, 2023

Description

instance parameter in the IMethodDecorator.Init method is currently null for constructor calls.
As described in #71 , it can be useful to have a reference to the instance.

The solution

The PR provides the instance reference for constructors. Now the only time the reference is not provided is for static members.

One caveat with this is that the object is only fully initialized after the constructor has finished, so providing the reference could cause issues if it's used for operations that require a fully initialized object.

Maybe this should be configurable by the user and disabled by default?

Todos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant