Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Improve consistency of type hierarchy checks - #1223

Merged
MichalStrehovsky merged 2 commits into
dotnet:masterfrom
MichalStrehovsky:isXXX
Apr 30, 2016
Merged

MichalStrehovsky merged 2 commits into
dotnet:masterfrom
MichalStrehovsky:isXXX

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Use IsXXX properties in lieu of "is XXX" checks.

Also, downgrade "is MetadataType" to "IsDefType" where it makes sense.

Use IsXXX properties in lieu of "is XXX" checks.

Also, downgrade "is MetadataType" to "IsDefType" where it makes sense.
}
}
else if (fieldType is DefType || fieldType is ArrayType || fieldType.IsByRef)
else if (fieldType.IsDefType || fieldType.IsArray || fieldType.IsByRef)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be simplified to: fieldType.IsObjRef || fieldType.IsByRef

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(And the cast a few lines up can be changed to DefType.)

@jkotas

jkotas commented Apr 30, 2016

Copy link
Copy Markdown
Member

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants