nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

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

Open hazzik opened this issue 1 year ago • 4 comments

Fixes #3536

hazzik avatar May 02 '24 00:05 hazzik

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 avatar May 02 '24 01:05 hazzik

@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).

hazzik avatar May 03 '24 00:05 hazzik

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.

fredericDelaporte avatar May 03 '24 00:05 fredericDelaporte

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

hazzik avatar May 03 '24 01:05 hazzik