[GHC] #15558: Locally handling an empty constraint
GHC
ghc-devs at haskell.org
Thu Aug 23 00:06:21 UTC 2018
#15558: Locally handling an empty constraint
-------------------------------------+-------------------------------------
Reporter: Ericson2314 | Owner: (none)
Type: task | Status: new
Priority: normal | Milestone: ⊥
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
error/warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
I'm not quite sure I understand what this ticket is about, but it's worth
noting that inaccessible code turned from an error to a warning in GHC
8.6.1, so your code does in fact compile as-is on 8.6.1:
{{{
$ /opt/ghc/8.6.1/bin/ghci Bug.hs
GHCi, version 8.6.0.20180810: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Asdf ( Bug.hs, interpreted )
Bug.hs:49:3: warning: [-Winaccessible-code]
• Couldn't match type ‘[b]’ with ‘Int’
Inaccessible code in
a pattern with constructor: X :: Sing Int, in a case alternative
• In the pattern: X
In a case alternative: X -> Bar 0 undefined
In the expression:
\case
X -> Bar 0 undefined
Y -> Bar [] False
|
49 | X -> Bar 0 undefined -- can't make this happy
| ^
}}}
Does this satisfy your use case?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15558#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list