Skip to content

RecordWildCards doesn't work with associated datatypes inside class instances

It seems like record wildcards (the ".." notation) don't work in the following scenario.

I tried with a standalone associated datatype and it works fine.

Tested with 6.10.1 and 6.11.20090103.

{-# LANGUAGE TypeFamilies, RecordWildCards #-}
module AssocWildCards where

class FooClass a where
   data FooType a

instance FooClass Int where
   data FooType Int = FooInt { fooIntVal :: Int }

fooInt :: Int -> FooType Int
fooInt fooIntVal = FooInt{..}

fromFooInt :: FooType Int -> Int
fromFooInt FooInt{..} = fooIntVal
Trac metadata
Trac field Value
Version 6.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC ganesh.sittampalam@credit-suisse.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information