summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/TyAppPat_Nonmatching.hs
blob: 4f03a4782ee023f7ce0d0334e59d0b617b5d7ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Main where

foo :: Maybe a -> a
foo (Just @Int x) = x
foo Nothing = 0

main = do
  print (foo (Just 5))