Skip to content

Conflicting unticked-promoted-constructors and operator-whitespace

Summary

operator-whitespace expects whitespace between infix operators and operator ticks.

Steps to reproduce

{-# LANGUAGE DataKinds #-}
import Data.Proxy(Proxy)
data Foo = Foo :< Foo | Bar

baz :: Proxy (Bar :< Bar)
{-
<interactive>:13:17: warning: [GHC-49957] [-Wunticked-promoted-constructors]
    Unticked promoted constructor: Bar.
    Suggested fix: Use 'Bar instead of Bar.

<interactive>:13:21: warning: [GHC-49957] [-Wunticked-promoted-constructors]
    Unticked promoted constructor: :<
    Suggested fix: Use ':< instead of :<

<interactive>:13:24: warning: [GHC-49957] [-Wunticked-promoted-constructors]
    Unticked promoted constructor: Bar.
    Suggested fix: Use 'Bar instead of Bar.
-}
foz :: Proxy ('Bar ':< 'Bar)
{-
<interactive>:14:23: warning: [GHC-40798] [-Woperator-whitespace]
    The suffix use of a ‘:<’ might be repurposed as special syntax
      by a future language extension.
    Suggested fix: Add whitespace around ‘:<’.
-}
faz :: Proxy ('Bar ' :< 'Bar)
{-
No error
-}

Expected behavior

foz :: Proxy ('Bar ':< 'Bar) should not throw error.

Environment

  • GHC version used: version 9.6.3

Optional:

  • Operating System: Linux(6.4.6)
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information