未验证 提交 53d3bddc 编写于 作者: T Tomáš Rylek 提交者: GitHub

Fix Crossgen2 compilation failures in several type generator tests (#51090)

As the PR

https://github.com/dotnet/runtime/pull/44041

effectively decoupled OwningType from Method in MethodWithToken,
I believe we now need to include OwningType in the Equals check,
otherwise we may (and sometimes do) crash in the assertion failure
checking that OwningType matches between instances.

Thanks

Tomas
上级 4b7d96a9
......@@ -221,8 +221,9 @@ public override int GetHashCode()
public bool Equals(MethodWithToken methodWithToken)
{
bool equals = Method == methodWithToken.Method && Token.Equals(methodWithToken.Token) && ConstrainedType == methodWithToken.ConstrainedType &&
Unboxing == methodWithToken.Unboxing;
bool equals = Method == methodWithToken.Method && Token.Equals(methodWithToken.Token)
&& OwningType == methodWithToken.OwningType && ConstrainedType == methodWithToken.ConstrainedType
&& Unboxing == methodWithToken.Unboxing;
if (equals)
{
Debug.Assert(OwningTypeNotDerivedFromToken == methodWithToken.OwningTypeNotDerivedFromToken);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册