-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Version Used: 7.3
Steps to Reproduce:
- Attempt to compile the following
public void Foo<T>(T value){
if (value == default)
}Expected Behavior: Compile error similar to value == default(T)
public void Foo<T>(T value){
if (value == default(T)) // <--- compile error as expected
}Actual Behavior: compiles into a null check for all types including value types and leads to situations where when T is int and value=0, value == default evaluates to false.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented