Use indefinite type sets in semantic checking

Resolves multiple type related issues, steming from the incorrect usage of mergeUp for type constraining, and the use of AnyType() to represent all types.