Add tests for the overriding of types

These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a