summaryrefslogtreecommitdiff
path: root/testsuite/tests/hpc/T20568.hs
blob: 929f3eeb1ce9083a7945991d9ee9b87c5693de0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE RebindableSyntax #-}

-- | Test for #20586 regression: rebindable if shouldn't crash
module Main where

import Prelude

main :: IO ()
main = print $ program
  where
    program :: AST
    program =
      if AstBool True
      then AstInt 1
      else AstInt 2

data AST =
    AstGT AST AST
  | AstInt Integer
  | AstBool Bool
  | IfThenElse AST AST AST
  deriving Show

ifThenElse :: AST -> AST -> AST -> AST
ifThenElse = IfThenElse