Ticket #3265 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Type operators can be defined without the TypeOperators extension flag

Reported by: nibro Owned by: simonpj
Priority: normal Milestone:
Component: Compiler Version: 6.10.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: rename/should_fail/T3265 Blocked By:
Blocking: Related Tickets:

Description

The following code is accepted without any extension flags given:

data a :*: b = Foo a b
type a :+: b = Either a b

However, to use the defined types we need the TypeOperators? flag, without it the following code will not be accepted:

f :: Int :*: Int -> Int
f (Foo x y) = x+y

It seems clear to me that GHC should not accept the former either without the TypeOperators? extension enabled.

Change History

Changed 4 years ago by simonpj

  • owner set to simonpj
  • difficulty set to Unknown

Changed 4 years ago by simonpj

  • status changed from new to closed
  • testcase set to rename/should_fail/T3265
  • resolution set to fixed

Quite right thanks. Fixed by

Tue Jun  2 14:37:06 BST 2009  simonpj@microsoft.com
  * Fix Trac #3265: type operators in type/class declarations
  
  We should accept these:
  
     data a :*: b = ....
  or
     data (:*:) a b = ...
  
  only if -XTypeOperators is in force.  And similarly class decls.

Simon

Note: See TracTickets for help on using tickets.