Skip to content

Treat all non-virtual methods of System.Object as not proxiable #3538

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

Merged
merged 2 commits into from
May 5, 2024

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented May 2, 2024

Fixes #3536

@hazzik
Copy link
Member Author

hazzik commented May 2, 2024

In theory we could mark all System.Object methods as not required to be proxiable. With non virtual methods it is understandable - we cannot override them anyway. But with virtual (ToString, GetHashCode, Eqauls) it is a bit trickier: user can override and seal the method. However, when we would be analyzing the class we would receive MyClass.ToString method for analysis, instead of object.ToString and it will say that the method should be proxiable although object.ToString is not required to be proxiable.

@hazzik
Copy link
Member Author

hazzik commented May 3, 2024

@fredericDelaporte, I have a question. Should I re-target the changes to an earlier version? If so what? (I think we need a support policy so it would be clearer in the future).

@fredericDelaporte
Copy link
Member

fredericDelaporte commented May 3, 2024

Since we usually take long for releasing the next minor version, yes, you are right, we should target a lower version. The currently released minor seems enough to me.

I would rather not target older versions. That is more work which gives an incentive for not upgrading to the latest minor, which I do not see as desirable. It is reasonable to let older versions be broken by .net versions which were not released when the older version was the latest.

@hazzik
Copy link
Member Author

hazzik commented May 3, 2024

Ok, cool. I'll squash and re-target to 5.5.x branch then.

@hazzik hazzik force-pushed the object-proxiable branch from f79f776 to 7fba579 Compare May 3, 2024 01:03
@hazzik hazzik changed the base branch from master to 5.5.x May 3, 2024 01:05
@hazzik hazzik force-pushed the object-proxiable branch from 7fba579 to 62f3be3 Compare May 3, 2024 01:05
@hazzik hazzik requested a review from fredericDelaporte May 3, 2024 11:38
@hazzik hazzik added this to the 5.5.2 milestone May 5, 2024
@hazzik hazzik merged commit 13dd509 into nhibernate:5.5.x May 5, 2024
23 checks passed
@hazzik hazzik deleted the object-proxiable branch May 5, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MemberwiseClone should be virtual error in dotnet 9 preview 3
2 participants