summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T3342.hs
blob: 7881aadb4e4682c51c9d174ba78386ae4ef560a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-}

module T3342 where

data F = FT String [F]
data G = GX F F | GY

spec :: F -> G
spec (FT "X"  [t1, t2]) = GX t1 t2
spec _                  = GY

-- walk :: F -> F
walk (spec -> GX _ t2) = walk t2
walk t@(FT _ _)        = t