haskell / happy

The Happy parser generator for Haskell
Other
276 stars 84 forks source link

New generated type signatures are overly general and cause type errors #104

Closed glguy closed 7 years ago

glguy commented 7 years ago

Since version 1.19.5 happy now add type signatures to the generated parser source file. These signatures can be too general and introduce type-errors into previous accepted parsers.

I haven't pinned down what specifically is triggering this bug, but you can reproduce it by trying to build cryptol-2.5.0

Cryptol makes use of the parameterized rules in happy, I'm going to explore if using these leads to the bug surfacing.

In the meantime, is there a flag I can use to disable these new type signatures?

harpocrates commented 7 years ago

I think this is a duplicate of https://github.com/simonmar/happy/issues/94. The workaround is to add type signatures on all productions.

harpocrates commented 7 years ago

In your case, you are only missing a signature on ipat. I can get Cryptol to build by adding that signature back:

ipat                           :: { Pattern PName }
  : ipat '#' ipat                 { at ($1,$3) $ PSplit $1 $3 }
  | apat                          { $1                        }
simonmar commented 7 years ago

Thanks for reporting - closing as dup of #94