Skip to content

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented Feb 4, 2020

Optimize typeof(T1).IsAssignableFrom(typeof(T2)) to true/false. E.g.

typeof(IEnumerable<object>).IsAssignableFrom(typeof(string[])); // to `true`

compareTypesForCast seems does everything I need for IsAssignableFrom: handles COMObjects, __Canon, covariance/contravariance, etc. The only thing - it gives up on Nullable<>.

Contributes to https://github.com/dotnet/coreclr/issues/2591

@jkotas
Copy link
Member Author

jkotas commented Feb 4, 2020

Reverting the revert.

cc @AndyAyersMS @EgorBo

@jkotas
Copy link
Member Author

jkotas commented Feb 4, 2020

Failures are known issues.

@jkotas jkotas merged commit 2ddc9d2 into master Feb 4, 2020
@stephentoub stephentoub deleted the revert-31643-revert-1195-type-isassignedfrom branch February 5, 2020 16:54
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants