Opened 5 months ago

Closed 5 months ago

#8574 closed bug (fixed)

Failure to require FlexibleContexts

Reported by: Feuerbach Owned by:
Priority: normal Milestone:
Component: Compiler (Parser) Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC accepts invalid program Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:


GHC accepts the following code without any extensions:

f :: Ord (i Int) => i Int -> i Int
f = undefined

It ought to require FlexibleContexts?.

Change History (4)

comment:1 Changed 5 months ago by monoidal

It seems this is valid Haskell 98:, section 4.1.3, the class is allowed to take (tyvar atype1 ... atypen) as an argument, and atype includes Int.

But the documentation, section 7.8.2 claims Haskell 98 requires (class (type-variable type-variable ...)) form. So I think this documentation should be changed to (class (type-variable type type ...)). Do you agree?

comment:2 Changed 5 months ago by Feuerbach

Ah, you're absolutely right. I should've read the report first!

comment:3 Changed 5 months ago by Krzysztof Gogolewski <krz.gogolewski@…>

In 4bbffb49ebddaa803f2c82c837a68553042f0793/ghc:

Fix documentation of FlexibleContexts (#8574)

comment:4 Changed 5 months ago by monoidal

  • Resolution set to fixed
  • Status changed from new to closed

Documentation fixed.

Note: See TracTickets for help on using tickets.