A decorator-based implementation of type checks.