[CSHARP-1949] BsonSerializer RegisterSerializer should validate serializer argument Created: 21/Mar/17 Updated: 05/Feb/18 Resolved: 05/Feb/18 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Description |
|
The untyped overloads of RegisterSerializer can't catch type mismatches at compile time. They are currently not being caught at runtime either, and mismatches result in difficult to diagnose errors later on when the driver attempts to use the mismatched serializer. For example, the following should be a runtime error:
|