Skip to content

GLR_Lib.hs "Couldn't match expected type ‘Bool’ with actual type ‘Int#’" #173

Open

Description

@andreasabel

GLR mode seems broken. Trying to compile the generated parser reports several instances of the error Couldn't match expected type ‘Bool’ with actual type ‘Int#’.
E.g

GLR_Lib.hs:236:33: error:
    • Couldn't match expected type ‘Bool’ with actual type ‘Int#’
    • In the expression: (this_state ==# goto this_state m)
      In a stmt of a list comprehension:
        (this_state ==# goto this_state m)
      In the expression:
        [m |
           (m, 0, _) <- rs,
           (this_state ==# goto this_state m),
           m `notElem` cyclic_names]

Activity

  1. taasan commented on Feb 13, 2021

    @taasan

    I get the same error (happy 1.19.12, Haskell Platform 2020.2)

    It works if I remove the --ghc flag

    --- /usr/share/doc/happy/examples/glr/bio-eg/Makefile	2001-09-09 03:46:40.000000000 +0200
    +++ Makefile	2021-02-13 19:41:36.462808073 +0100
    @@ -14,7 +14,7 @@
     	${GHC} -cpp -fglasgow-exts  -o ${PROG} --make Main.lhs
     
     BioData.hs Bio.hs : Bio.y
    -	${HAPPY} --info --glr --ghc ${FILTER} $<
    +	${HAPPY} --info --glr ${FILTER} $<
     
     Bio.o : Bio.hs BioData.hi
     	${GHC} -cpp -fglasgow-exts  -O2 -c Bio.hs
  2. andreasabel commented on Feb 14, 2021

    @andreasabel
    MemberAuthor

    Thanks @taasan for the hint, that helped me to fix BNFC/bnfc#340!

  3. Ericson2314 commented on Feb 14, 2021

    @Ericson2314
    Collaborator

    @andreasabel do you know what version you encountered this originally in? (Or, to cut to the chase, was it 3.20 the latest?)

  4. andreasabel commented on Feb 14, 2021

    @andreasabel
    MemberAuthor

    @andreasabel do you know what version you encountered this originally in? (Or, to cut to the chase, was it 3.20 the latest?)

    No, this issue is quite a bit older. A couple of years... Could it be due to some non-backwards compatible change in GHC?

  5. Ericson2314 commented on Feb 25, 2021

    @Ericson2314
    Collaborator

    Thanks, @andreasabel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions