
#13635: Incorrect result at runtime with list comprehensions in that case -------------------------------------+------------------------------------- Reporter: vanto | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 1. With GHC 8.0.2\\ {{{ Prelude> [x | x <- [_, _], False] <interactive>:1:12: error: * Found hole: _ :: t Where: `t' is a rigid type variable bound by the inferred type of it :: [t] at <interactive>:1:1 * In the expression: _ In the expression: [_, _] In a stmt of a list comprehension: x <- [_, _] * Relevant bindings include it :: [t] (bound at <interactive>:1:1) <interactive>:1:15: error: * Found hole: _ :: t Where: `t' is a rigid type variable bound by the inferred type of it :: [t] at <interactive>:1:1 * In the expression: _ In the expression: [_, _] In a stmt of a list comprehension: x <- [_, _] * Relevant bindings include it :: [t] (bound at <interactive>:1:1) Prelude>\\ }}} This result makes no sense here.\\ The result will always be the empty list [].\\ 2. With GHC 7.6.3\\ {{{ Prelude> [x | x <- [_, _], False] <interactive>:2:12: Pattern syntax in expression context: _ <interactive>:2:12: Pattern syntax in expression context: _ Prelude> }}} This result also makes no sense here.\\ Similarly this result will always be the empty list []. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13635 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler