Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ private BoundBlock GenerateAwaitForIncompleteTask(LocalSymbol awaiterTemp, Bound

if (!TypeSymbol.Equals(awaiterFieldType, awaiterTemp.Type, TypeCompareKind.ConsiderEverything2))
{
Debug.Assert(awaiterFieldType.IsObjectType());
Debug.Assert(awaiterFieldType.IsObjectType() || TypeSymbol.Equals(awaiterFieldType, awaiterTempRef.Type, TypeCompareKind.AllIgnoreOptions));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test?

Theoretically it can be done, but I prefer to not spend time on that in context of this PR. Especially that the change doesn't affect the behavior. The fact that there is a follow up pending for a type comparison is "recorded" by TypeCompareKind.ConsiderEverything2 on the previous line. Most likely, we should be using TypeCompareKind.AllIgnoreOptions there, but I prefer to avoid introducing any potential behavior changes in this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks.

Conversion c = F.ClassifyEmitConversion(awaiterTempRef, awaiterFieldType);
Debug.Assert(c.IsImplicit);
Debug.Assert(c.IsReference || c.IsIdentity);
Expand Down Expand Up @@ -533,7 +533,7 @@ private BoundBlock GenerateAwaitForIncompleteTask(LocalSymbol awaiterTemp, Bound

if (!TypeSymbol.Equals(awaiterTemp.Type, awaiterField.Type, TypeCompareKind.ConsiderEverything2))
{
Debug.Assert(awaiterFieldRef.Type.IsObjectType());
Debug.Assert(awaiterFieldRef.Type.IsObjectType() || TypeSymbol.Equals(awaiterTemp.Type, awaiterFieldRef.Type, TypeCompareKind.AllIgnoreOptions));
Conversion c = F.ClassifyEmitConversion(awaiterFieldRef, awaiterTemp.Type);
Debug.Assert(c.IsReference || c.IsIdentity);
awaiterFieldRef = F.Convert(awaiterTemp.Type, awaiterFieldRef, c);
Expand Down