[CSHARP-4650] LINQ3 provider: ValueType 'X' of parameterSerializer does not match parameter type 'Y' (where X is a subclass of Y) Created: 11/May/23 Updated: 12/May/23 Resolved: 12/May/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | 2.19.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Roberto Pérez | Assignee: | Robert Stam |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
| Comments |
| Comment by Robert Stam [ 12/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am able to reproduce this with the code you have provided. Thanks for making it easy to reproduce. The issue arises because in the one scenario that doesn't work you are passing an instance of `IMongoQueryable<DeletedCar>` to the first parameter of `GetCarDescription_Fails` and this parameter is of type `IQueryable<Car>`. This compiles because of covariance. This is the same issue as reported in CSHARP-4535 so I am closing this issue as a duplicate. You can follow that ticket. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roberto Pérez [ 11/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please remove the How to Reproduce section in the Description since it is better described in the comments above | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roberto Pérez [ 11/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Output: V2 - Description for license: 5555XXX V2 - Description for license: 5555XXX V3 - Description for license: 5555XXX V3 - Description for license: 5555XXX Unhandled Exception: System.ArgumentException: ValueType 'Sample.Program+DeletedCar' of parameterSerializer does not match parameter type 'Sample.Program+Car'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roberto Pérez [ 11/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by PM Bot [ 11/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi suikevil, thank you for reporting this issue! The team will look into it and get back to you soon. |