typeinfo: more resilience for user-defined types (#26630)
Currently, if a user-defined collection-like type doesn't handle
the typeinfo property, an assertion is thrown in some circumstances.
This strictness is here lifted up, and maintained only for types
defined in Core/Base.