Ticket #3540 (closed merge: fixed)

Opened 4 years ago

Last modified 4 years ago

Parser accepts malformed types with implicit parameters

Reported by: benl Owned by: igloo
Priority: normal Milestone: 6.12 branch
Component: Compiler (Parser) Version: 6.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: typecheck/should_fail/T3540 Blocked By:
Blocking: Related Tickets:

Description

The parser in GHC 6.11 currently accepts this:

thing :: (?dude :: Int) -> Int
thing = undefined

Where the type should really be written with => like

thing :: (?dude :: Int) => Int
thing = undefined

Running hlint on the malformed-but-accepted-by-GHC version crashes haskell-src-exts:

benl@humboldt:~$ cat tmp/Main.hs 
main = undefined

thing :: (?dude :: Int) -> Int
thing = undefined

benl@humboldt:~$ hlint tmp/Main.hs 
hlint: src/Language/Haskell/Exts/ParseUtils.hs:(841,18)-(863,53): Non-exhaustive patterns in case

Change History

Changed 4 years ago by benl

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12 branch

Changed 4 years ago by simonpj

  • owner set to igloo
  • testcase set to typecheck/should_fail/T3540
  • type changed from bug to merge

Fixed by

Wed Sep 30 03:47:03 PDT 2009  simonpj@microsoft.com
  * Fix Trac #3540: malformed types
  Ignore-this: bbd5543b88e6beadd1a9ae9d0ebce15e
  
  Tidy up the way that predicates are handled inside types

    M ./compiler/typecheck/TcBinds.lhs -12 +15
    M ./compiler/typecheck/TcHsType.lhs -19 +24
    M ./compiler/typecheck/TcMType.lhs -10 +9

Worth merging to 6.12 if easy

Simon

Changed 4 years ago by simonpj

These two testsuite patches belong with the above change

Wed Sep 30 04:07:42 PDT 2009  simonpj@microsoft.com
  * Track error message changes
  Ignore-this: cac29e62d8f2e0a6293db4969ad9e8c3

    M ./tests/ghc-regress/indexed-types/should_compile/Simple13.hs +3
    M ./tests/ghc-regress/indexed-types/should_fail/Simple14.stderr -1 +1
    M ./tests/ghc-regress/typecheck/should_compile/all.T +1
    M ./tests/ghc-regress/typecheck/should_fail/T2994.hs +2
    M ./tests/ghc-regress/typecheck/should_fail/T2994.stderr -5 +9

and

Wed Sep 30 04:07:12 PDT 2009  simonpj@microsoft.com
  * Test Trac #3540
  Ignore-this: 1329e8d3902ccf4080c3f4dfe4c90b9d

    A ./tests/ghc-regress/typecheck/should_fail/T3540.hs
    A ./tests/ghc-regress/typecheck/should_fail/T3540.stderr
    M ./tests/ghc-regress/typecheck/should_fail/all.T +1

Changed 4 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged.

Note: See TracTickets for help on using tickets.