Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Does not support ref/out parameters #2

Closed
H1M4W4R1 opened this issue Jan 22, 2021 · 2 comments
Closed

Does not support ref/out parameters #2

H1M4W4R1 opened this issue Jan 22, 2021 · 2 comments
Labels
help wanted Extra attention is needed wontfix This will not be worked on

Comments

@H1M4W4R1
Copy link
Owner

Implementation of that feature will be quite complicated, because it would require to encapsulate those params into additional class structure that would store it inside during Aspect Processing execution and return it afterwards.

Another way is to rework the encapsulation system to amend original method body adding execution start and end calls into that body, however it would require to do this also on return statements, which is also quite hard because it requires to scan whole method body for those statements.

@H1M4W4R1
Copy link
Owner Author

Possible solution
MethodInfo.Invoke uses object[] as parameter container. object[] is an reference type and while executing method it's data is also changed while method has ref and out parameters. The data is not changed if it's modified inside executed method and param is not marked as out/ref. Thanks to this it allows us to move data array from executing encapsulated method to separate variable that is then provided to encapsulator and set parent variables with out/ref basing on that array.

@H1M4W4R1 H1M4W4R1 added wontfix This will not be worked on help wanted Extra attention is needed labels Jan 14, 2022
@H1M4W4R1
Copy link
Owner Author

Moved to #7
Partially fixed in #7, needs testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant