Skip to content

Role annotations are not printed in TemplateHaskell brackets

Summary

{-# LANGUAGE RoleAnnotations, TemplateHaskell #-}
{-# OPTIONS -v0 -ddump-splices -dsuppress-uniques #-}

$([d| type role P phantom
      data P a
    |])

produces

A.hs:(4,3)-(6,6): Splicing declarations
    [d| data P a |]
  ======>
    type role P phantom
    data P a

but hey, where's the role annotation in the printed bracket?

Steps to reproduce

Load the example in GHCi.

Expected behavior

The output must be:

A.hs:(4,3)-(6,6): Splicing declarations
    [d| type role P phantom
        data P a |]
  ======>
    type role P phantom
    data P a

Environment

  • GHC version used: 8.4.4, HEAD
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information