You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Incorrect trimming of static properties when DIM is involved #2865
I'm attempting to add a static virtual DIM (AllBitsSet) to an interface (IBinaryNumber), and then override it in a child (BigInteger). However, the test is failing because the DIM is being called instead of the child's implementation of it.
System.Numerics.Tests.BigIntegerTests_GenericMath.AllBitsSetTest [FAIL]
Assert.Equal() Failure
Expected: -1 (this is what BigInteger.AllBitsSet should return
Actual: 1 (this is what the IBinaryNumber DIM returns)
More info
if you observe .\artifacts\obj\System.Runtime.Numerics\Release\net7.0\System.Runtime.Numerics.dll
vs .\artifacts\obj\System.Runtime.Numerics\Release\net7.0\PreTrim\System.Runtime.Numerics.dll
in a tool like ildasm, you'll see that the former has AllBitsSet and the latter is missing it. I suspect this is a trimmer bug.
It seems like similar issues have been looked at already (#2058) (#2711). Given that properties seem to still be buggy, @tannergooding recommends testing properties, events, and other member types explicitly.
Activity
tannergooding commentedon Jun 24, 2022
CC. @vitek-karas, @agocke
agocke commentedon Jun 25, 2022
@jtschuster
agocke commentedon Jul 27, 2022
I believe this is fixed.
Separate interface method trimming logic and update for static interf…
Separate interface method trimming logic and update for static interf…