Skip to content

Type aliases for TypeError constrains fire during compilation time

Hello!

The following code should compile fine:

module Main where 

import GHC.TypeLits (ErrorMessage(Text, ShowType, (:<>:)), TypeError)

type MyError a b = TypeError (ShowType a :<>: ShowType b)

main :: IO ()
main = return ()

but it raises an error during compilation:

Main.hs:5:1: error:
    • ab
    • In the type synonym declaration for ‘MyError’
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information