SERVER-105897ClosedFixed

Make all BSONElement accessors validate that the type is as expected

Currently, {{BSONElement}} accessors do not validate that the type expected by the API matches the actual contents of the referred-to element. Identify a way to add type checking to {{BSONElement}} accessors with an acceptable performance overhead. To maximize chance of success, we can consider it a programmer error to call accessors in a type-mismatched fashion and use {{tassert}} or low-overhead server-aborting mechanisms like {{MONGO_UNREACHABLE}} or {{{}__builtin_trap(){}}}.

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc0
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.