summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/should_compile/pmc007.hs
blob: 301cdbbac251a5208cb07c3254b670b55f6fc35c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# OPTIONS_GHC -fwarn-incomplete-patterns -fwarn-overlapping-patterns #-}
{-# LANGUAGE OverloadedStrings #-}

module PMC007 where

-- overloaded
f "ab" = ()
f "ac" = ()

-- non-overloaded
g :: String -> ()
g "ab" = ()
g "ac" = ()

-- non-overloaded due to type inference
h :: String -> ()
h s = let s' = s
      in  case s' of
            "ab" -> ()
            "ac" -> ()