error when running ghc with the plugin directly: Illegal type specification for `Even.notEven`, tests/pos/Even.hs:5:16:
jwaldmann opened this issue · comments
jwaldmann commented
$ /opt/ghc/ghc-9.8.1/bin/ghc -fforce-recomp -package base -fplugin=LiquidHaskell tests/pos/Even.hs
Loaded package environment from /home/waldmann/.ghc/x86_64-linux-9.8.1/environments/default
[1 of 1] Compiling Even ( tests/pos/Even.hs, tests/pos/Even.o )
tests/pos/Even.hs:5:16: error:
Illegal type specification for `Even.notEven`
Even.notEven :: lq_tmp$db##0:GHC.Types.Int -> {VV##0 : GHC.Types.Int | VV##0 mod 2 == 0}
Sort Error in Refinement: {VV##0 : GHC.Types.Int | VV##0 mod 2 == 0}
Operands have different types GHC.Types.Int and int in VV##0 mod 2
Just
|
5 | {-@ notEven :: Int -> Even @-}
| ^^^^^^^^^^^^
jwaldmann commented
works via stack:
$ PATH=/opt/ghc/ghc-9.8.1/bin:$PATH stack exec -- ghc -fforce-recomp -fplugin=LiquidHaskell tests/pos/Even.hs
Warning: Stack has not been tested with GHC versions 9.8 and above, and using 9.8.1, this may fail.
[1 of 1] Compiling Even ( tests/pos/Even.hs, tests/pos/Even.o )
**** LIQUID: SAFE (1 constraints checked) **************************************
Ranjit Jhala commented
Yes, there's probably some extra path shenanigans that stack
takes care of in this case, thanks!