-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operator as
should not be used with non-nullable value type.
#1903
Comments
as
should be used with non-nullable value type.as
should not be used with non-nullable value type.
The new instruction sequence:
is somewhat tricky to translate in isolation: What's happening here is that this example gets handled by a special-case that was intended for nullable |
If I fix the
which is not exactly an improvement. Not sure what we can do here without implementing full pattern matching support (#2048). |
New decompiled code:
We now split the statement involving |
Tested with master + roslyn 3.4.0
Seems roslyn 3.1.0 start to use an new mode and can not be proper translated by ILSpy.
See also
https://sharplab.io/#v2:D4AQTAjAsAULIGYAE4kGEkG9ZNy5IEAbEgJYB2ALkgLIQA8AKgHwAUjSlAlFjnvyADsSVtVIBnMlTI8A/GSQAuJAFoIAbj64AvlvwpiU6jQRM2AewBGAKwCmAY2rdeMfgOGiykimLkLlapqueLow2kA=
Orig Code
M3
works well, and it is just to be used to compare with M1IL
Expected
//Will get the below code if you change typeof t from
T
toobject
Actual
Old Code from Roslyn 2.10
Decompile code
The text was updated successfully, but these errors were encountered: