Opened 10 years ago

Closed 9 years ago

Last modified 17 months ago

#301 closed bug (fixed)

GADT constructor constraints ignored

Reported by: wolfram_kahl Owned by: simonpj
Priority: normal Milestone: 6.8.1
Component: Compiler (Type checker) Version: 6.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Test Case: gadt/karl1, gadt/karl2
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description (last modified by simonmar)

Class constraints on GADT constructore appear to be
ignored.

I tried:

data Expr :: * -> * where
  Const :: Show a => a -> Expr a
  Apply :: Fct a b -> Expr a -> Expr b

and there is no way to define the expected constraint-less
Show instance --- for details, see Expr0.lhs.

Attachments (3)

Expr0.2.lhs (3.9 KB) - added by wolfram_kahl 10 years ago.
Expr1.2.lhs (1.8 KB) - added by wolfram_kahl 10 years ago.
Expr1a.2.lhs (1.3 KB) - added by wolfram_kahl 10 years ago.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by wolfram_kahl

Changed 10 years ago by wolfram_kahl

comment:1 Changed 10 years ago by wolfram_kahl

Logged In: YES 
user_id=1212105

For a simpler example, see Expr1.lhs

Changed 10 years ago by wolfram_kahl

comment:2 Changed 10 years ago by wolfram_kahl

Logged In: YES 
user_id=1212105

The expected solution would be that constrained constructors are
translated into constructors with an additional dictionary
argument,
as sketched in Expr1a.lhs.

comment:3 Changed 9 years ago by simonmar

  • Description modified (diff)
  • Owner changed from nobody to simonpj
  • Status changed from assigned to new

comment:4 Changed 9 years ago by simonpj

  • Architecture set to Unknown
  • difficulty set to Unknown
  • Milestone set to 6.8
  • Operating System set to Unknown

comment:5 Changed 9 years ago by simonpj

  • Resolution changed from None to fixed
  • Status changed from new to closed
  • Test Case set to gadt/karl1, gadt/karl2

Fixed at last (the implication-consraint patch)

Simon

comment:6 Changed 8 years ago by igloo

  • Milestone changed from 6.8 branch to 6.8.1

comment:7 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:8 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:9 Changed 17 months ago by simonpj <simonpj@…>

In e9741fd3a5412fd9c8ef9985973d0bde20e525ce/ghc:

Add two GADT tests for Trac #301, fixed by implication constraints
Note: See TracTickets for help on using tickets.