diff options
Diffstat (limited to 'testsuite/tests/profiling/should_compile/T15108.hs')
-rw-r--r-- | testsuite/tests/profiling/should_compile/T15108.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/profiling/should_compile/T15108.hs b/testsuite/tests/profiling/should_compile/T15108.hs new file mode 100644 index 0000000000..d0143bf849 --- /dev/null +++ b/testsuite/tests/profiling/should_compile/T15108.hs @@ -0,0 +1,22 @@ +module Main where + +main :: IO () +main = do + _ <- return $ getInt Circle + return () + +newtype MyInt = MyInt Int + +data Shape = Circle | Square + +getInt :: Shape -> MyInt +getInt sh = + case sh of + Circle -> + let (MyInt i) = MyInt 3 + in myInt i + Square -> + let (MyInt i) = MyInt 2 + in myInt i + where + myInt = MyInt |