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 }}
Repository navigation
Managed type system casting logic doesn't handle all array variance #85146
Just a thing to clarify: The is keyword actually returns true as soon as an implicit conversion is possible? I thought it only returns true on exact type matches :D
Activity
Fabi commentedon Apr 21, 2023
Just a thing to clarify: The
iskeyword actually returns true as soon as an implicit conversion is possible? I thought it only returns true on exact type matches :DMichalStrehovsky commentedon Apr 21, 2023
It returns true if a cast can succeed.
You can do
((IEnumerable<Enum1>)source).GetType()and you'll getEnum0[]. There's no conversion involved, just a type check.Fabi commentedon Apr 21, 2023
That's good to know, thank you. I always expected it to only return true on exact type matches for types you defined.
Fix handling of variant casting in the managed type system
Fix handling of variant casting in the managed type system (#91788)