-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Server Security
-
ALL
Given an IDL type definition like:
mytype: bson_serialization_type: any cpp_type: MyType deserializer: "mongo::parseMyType" serializer: "::mongo::serializeMyType"
Serialization will call `mongo::serializeMyType(const MyType& val, StringData fieldName, BSONObjBuilder* builder)`, however when the serialization type is narrowed, such as the following, the "::" prefix denoting a free function is ignored, and the type is serialized as `myType.serializeMyType(StringData fieldName, BSONObjBuilder* builder) const`.
mytype: bson_serialization_type: [int, long, decimal, double] cpp_type: MyType deserializer: "mongo::parseMyType" serializer: "::mongo::serializeMyType"
The behavior current exhibited by the `any` case at top is correct, while the more narrow type below is not.