Opened 5 months ago

Last modified 5 months ago

#13933 new bug

Support Typeable instances for types with coercions

Reported by: goldfire Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.3
Keywords: TypeInType, Typeable Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #13872 Differential Rev(s):
Wiki Page:

Description

If I say

{-# LANGUAGE GADTs, TypeApplications, TypeInType #-}

module Bug where

import Type.Reflection

data G a where
  MkG :: a ~ Bool => G a

rep = typeRep @MkG

I get

Bug.hs:10:7: error:
    • No instance for (Typeable <>) arising from a use of ‘typeRep’
    • In the expression: typeRep @MkG
      In an equation for ‘rep’: rep = typeRep @MkG
   |
10 | rep = typeRep @MkG
   |   

First off, the error message is confusing, mentioning the mysterious <>. But more importantly, it would be nice if the Typeable mechanism supported coercions.

Change History (1)

comment:1 Changed 5 months ago by RyanGlScott

Note: See TracTickets for help on using tickets.