Missing stage restriction check in master
M.hs
```hs
{-# LANGUAGE TemplateHaskell #-}
module M where
type T = Int
a = $(undefined :: T)
```
In 9.10 and 9.12, this correctly fails with:
```
• GHC stage restriction:
‘T’ is used in a top-level splice, quasi-quote, or annotation,
and must be imported, not defined locally
```
But in master as of b255a8ca8, it fails with:
```
• GHC internal error: ‘T’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: []
• In an expression type signature: T
In the expression: undefined :: T
In the untyped splice: $(undefined :: T)
|
6 | a = $(undefined :: T)
| ^
```
issue