ucsd-progsys / liquidhaskell

Liquid Types For Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reflecting fails when using otherwise

facundominguez opened this issue · comments

The following test fails with:

module Test where
import GHC.Types

{-@ reflect g @-}
g :: Int -> Int
g x | x > 0 = x
    | otherwise = x
$ liquidhaskell_boot_datadir=$PWD/liquidhaskell-boot cabal exec -- liquidhaskell test.hs -fforce-recomp
[1 of 1] Compiling Test             ( test.hs, test.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 9.2.5:
	Data.Binary.Get.runGet at position 35466: not enough bytes
CallStack (from HasCallStack):
  error, called at libraries/binary/src/Data/Binary/Get.hs:345:5 in binary-0.8.9.0:Data.Binary.Get

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

While this variant works fine:

module Test where
import GHC.Types

{-@ reflect g @-}
g :: Int -> Int
g x = if x > 0 then x else x