blob: 97ff3caf4e57247f25a159b1ef7853f2b9ccf222 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
{-# LANGUAGE MagicHash #-}
-- Tests tagToEnum# hacks
module ShouldFail where
import GHC.Base
-- Test 1: Polymorphic
f :: a
f = tagToEnum# 0#
-- Test 2: Int value (not an Enumeration TyCon)
class Unboxable value where
readUnboxable :: Int -> value
instance Unboxable Int where
readUnboxable (I# value#) = tagToEnum# value#
|