get Common Type
@NotNull
This function is a relict from the old ages. It iterates through a collection of types and returns the type they have in *common*. For example, if two types `A` and `B` both derive from the interface `C`` then `C` would be returned. Because this contains some legacy code that does crazy stuff, we need access to scope information, so we can build a map between type information and their record declarations. We want to get rid of that in the future.
Return
the common type
Parameters
types
the types to compare
provider