Opened 2 years ago

Closed 18 months ago

Last modified 18 months ago

#14421 closed bug (fixed)

LambdaCase should be suggested if it is used but not enabled

Reported by: tomjaguarpaw Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler (Parser) Version: 8.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: parser/should_fail/ParserNoLambdaCase
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D4260
Wiki Page:

Description

If I try to make a multiparameter typeclass GHC (well, GHCi here) advises me to turn on MultiParamTypeClasses

Prelude> class C a b where
...
  (Use MultiParamTypeClasses to allow multi-parameter classes)

But if I try to use \case it doesn't give me a helpful suggestion

Prelude> :t \case (_,_) -> ()

<interactive>:1:2: error: parse error on input ‘case’

Could it?

Change History (3)

comment:1 Changed 18 months ago by sighingnow

Differential Rev(s): Phab:D4260
Resolution: fixed
Status: newclosed

This ticket has already implemented in the BlockArguments patch, which will be included in ghc-8.6.1. With ghc-HEAD, you will get:

Prelude> :t \case (_,_) -> ()

<interactive>:1:2: error: Illegal lambda-case (use -XLambdaCase)

comment:2 Changed 18 months ago by sighingnow

Milestone: 8.6.1

comment:3 Changed 18 months ago by sighingnow

Component: CompilerCompiler (Parser)
Test Case: parser/should_fail/ParserNoLambdaCase
Note: See TracTickets for help on using tickets.