[GHC] #12879: (xs -> xs) wrongly suggests TypeApplications
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Poor/confusing Unknown/Multiple | error message Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- `(xs -> xs)` and `map (xs -> xs)` wrongly suggest `TypeApplications` {{{
map (xs -> xs)
<interactive>:38:6: error: Pattern syntax in expression context: xs -> xs Did you mean to enable TypeApplications? }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by zyla): I believe this is fixed in HEAD: {{{ GHCi, version 8.1.20161209: http://www.haskell.org/ghc/ :? for help Prelude> map (xs -> xs) <interactive>:1:6: error: Pattern syntax in expression context: xs -> xs Prelude> }}} But there's another issue - the message still appears when using as- patterns when TypeApplications is already enabled: {{{ Prelude> :set -XTypeApplications Prelude> map (xs@xs) <interactive>:19:6: error: Pattern syntax in expression context: xs@xs Did you mean to enable TypeApplications? }}} Perhaps replacing it with `Type application syntax requires a space before '@'` is a good idea in this case? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): That would be a good error message -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2877 Wiki Page: | -------------------------------------+------------------------------------- Changes (by zyla): * differential: => Phab:D2877 Comment: I submitted a patch: https://phabricator.haskell.org/D2877 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2877 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"b28ca38e6e1d75f3c10cc593cdd2ac80ec29690f/ghc" b28ca38/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b28ca38e6e1d75f3c10cc593cdd2ac80ec29690f" Don't suggest enabling TypeApplications when it's already enabled Previously when encountering EAsPat in an expression context, TypeApplications was suggested even when already enabled. This patch replaces the suggestion with more appropriate message. Test Plan: validate Reviewers: austin, bgamari, mpickering, goldfire, simonpj Reviewed By: mpickering, goldfire, simonpj Subscribers: simonpj, goldfire, mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2877 GHC Trac Issues: #12879 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12879: (xs -> xs) wrongly suggests TypeApplications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2877 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12879#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC