BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

Generate warning-free Haskell code #331

Closed andreasabel closed 3 years ago

andreasabel commented 3 years ago

Recover the property of BNFC 2.7.1 to generate warning-free Haskell code https://github.com/BNFC/bnfc/blame/0ad87322fce4cfe309512fa9fd56a63a06ff9c19/source/CHANGELOG.md#L117

andreasabel commented 3 years ago

89e591487064652a6415589395593da9ffeab190 breaks compilation with GHC 7.10:

$ cabal build -w ghc-7.10.3
...
HierMod/Skel.hs:3:16:
    unknown flag in  {-# OPTIONS_GHC #-} pragma: -Wno-unused-matches
andreasabel commented 3 years ago

Seems like the default test cases for XML and Haskell/GADT are now warning-free (testsuite passes).

andreasabel commented 3 years ago

There is a warning in Haskell/GADT with ghc 9.0:

ghc -XNoImplicitPrelude -Wall -Werror TestTest
[1 of 8] Compiling ComposOp         ( ComposOp.hs, ComposOp.o )
[2 of 8] Compiling AbsTest          ( AbsTest.hs, AbsTest.o )

AbsTest.hs:23:21: error: [-Wstar-is-type, -Werror=star-is-type]
    Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
    relies on the StarIsType extension, which will become
    deprecated in the future.
    Suggested fix: use ‘Type’ from ‘Data.Kind’ instead.
   |
23 | data Tree :: Tag -> * where

Dropping GHC 7.10, we could assume base-4.9 and use Data.Kind.Type instead of *. The StarIsType extension exists only since GHC 8.6 and is, while on by default, deprecated, to move away from * for Type.

andreasabel commented 3 years ago

Haskell-GADT moved to issue #346.