Skip to content
Snippets Groups Projects
Commit 232cfc24 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot
Browse files

Add regression test for #22328

parent c6e1f3cd
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE TypeApplications, PatternSynonyms, GADTs, ViewPatterns #-}
module T22328 where
import Data.Typeable
data Gadt x y where
ExistentialInGadt :: Typeable a => a -> Gadt x x
pattern CastGadt :: Typeable a => x ~ y => a -> Gadt x y
pattern CastGadt a <- ExistentialInGadt (cast -> Just a)
test :: Gadt i o -> Bool
test gadt = case gadt of
CastGadt @Bool a -> a
_ -> False
......@@ -84,3 +84,4 @@ test('T14630', normal, compile, ['-Wname-shadowing'])
test('T21531', [ grep_errmsg(r'INLINE') ], compile, ['-ddump-ds'])
test('T22521', normal, compile, [''])
test('T23038', normal, compile_fail, [''])
test('T22328', normal, compile, [''])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment