[GHC] #9778: Namespace collision detection for promoted types
GHC
ghc-devs at haskell.org
Sun Nov 30 00:49:14 UTC 2014
#9778: Namespace collision detection for promoted types
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: carlostome
Type: feature | Status: new
request | Milestone:
Priority: normal | Version: 7.8.3
Component: Compiler | Keywords: newcomer
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: T9778 |
Blocking: |
Differential Revisions: Phab:D534 |
-------------------------------------+-------------------------------------
Changes (by carlostome):
* testcase: => T9778
* differential: => Phab:D534
Comment:
I added this warning flag and updated the documentation according to it.
The new flag is documented as follows:
----
-fwarn-unticked-promoted-constructors:
Warn if a promoted data constructor is used without a tick preceding
it's name.
For example:
{{{
data Nat = Succ Nat | Zero
data Vec n s where
Nil :: Vec Zero a
Cons :: a -> Vec n a -> Vec (Succ n) a
}}}
This program will raise two warnings because Zero and Succ are not
written as 'Zero and 'Succ.
This warning is off by default.
----
If anybody thinks this can be explained better, all suggestions are
welcomed!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9778#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list