Unfortunately, the `Def` enum in the ast uses `DefTy` for both enums and typedefs. Instead of refactoring the whole compiler, I figured I'd just use the same pattern (for better or for worse).

We're guaranteed that they'll never clash because they're in the same namespace (resolve checks that)