Opened 12 years ago

Closed 10 years ago

Last modified 3 years 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: None/Unknown Test Case: gadt/karl1, gadt/karl2
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

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 12 years ago.
Expr1.2.lhs (1.8 KB) - added by wolfram_kahl 12 years ago.
Expr1a.2.lhs (1.3 KB) - added by wolfram_kahl 12 years ago.

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by wolfram_kahl

Attachment: Expr0.2.lhs added

Changed 12 years ago by wolfram_kahl

Attachment: Expr1.2.lhs added

comment:1 Changed 12 years ago by wolfram_kahl

Logged In: YES 
user_id=1212105

For a simpler example, see Expr1.lhs

Changed 12 years ago by wolfram_kahl

Attachment: Expr1a.2.lhs added

comment:2 Changed 12 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 11 years ago by simonmar

Description: modified (diff)
Owner: changed from nobody to simonpj
Status: assignednew

comment:4 Changed 10 years ago by simonpj

Architecture: Unknown
difficulty: Unknown
Milestone: 6.8
Operating System: Unknown

comment:5 Changed 10 years ago by simonpj

Resolution: Nonefixed
Status: newclosed
Test Case: gadt/karl1, gadt/karl2

Fixed at last (the implication-consraint patch)

Simon

comment:6 Changed 9 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:7 Changed 8 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:8 Changed 8 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:9 Changed 3 years 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.