GHC Internal error when using deriving via on a data instance.
Compilation fails on provided source file with:
Bug.hs:17:53: error: • GHC internal error: ‘m’ is not in scope during type checking, but it passed the renamer tcl_env of environment: [at2 :-> Type variable ‘m’ = m :: *, rrO :-> APromotionErr FamDataConPE] • In the first argument of ‘Block’, namely ‘m’ In the first argument of ‘Header’, namely ‘(Block m)’ In the first argument of ‘AllowThunk’, namely ‘(Header (Block m))’ | 17 | deriving NoThunks via AllowThunk (Header (Block m)) | ^
Steps to reproduce
Compile the file attached to the issue.
With GHC version 8.6.5 it compiles with no warnings.
- GHC version used: 8.8.3
- Operating System: MacOS, Linux
- System Architecture: x86_64