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
ranma42
changed the title
Incorrect results when coalescing expression of different types
Incorrect results when coalescing expressions of different types
Jan 22, 2025
InferTypeMapping goes through all arguments and takes first non-null mapping as a result, so we take the type mapping from the left, which is int. Dupe of #15586
Bug description
The
??
operator can return unexpected results when applied to operands with a different type (mapping).In the attached code, the expected result for the
null ?? 2.25
case would be2.25
, but EFCore actually returns2
.Your code
Stack traces
Verbose output
EF Core version
9.0.1
Database provider
Microsoft.EntityFrameworkCore.Sqlite
Target framework
.NET 9.0
Operating system
Kali Linux
IDE
Visual Studio Code 1.96.4
The text was updated successfully, but these errors were encountered: