Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Building Alex fails on GHC 7.7 due to wrong primps #30

Closed
christiaanb opened this Issue Sep 27, 2013 · 3 comments

Comments

Projects
None yet
3 participants

It seems the new primops are only used when bootstrapping GHC-7.7 from GHC-7.6, not when building alex with GHC-7.7. Here are the errors that I get:

[20 of 22] Compiling Scan             ( dist/build/alex/alex-tmp/Scan.hs, dist/build/alex/alex-tmp/Scan.o )

dist/build/alex/alex-tmp/Scan.hs:349:29:
    Couldn't match expected type ‛Bool’ with actual type ‛Int#’
    In the first argument of ‛(&&)’, namely ‛(offset >=# 0#)’
    In the expression: (offset >=# 0#) && (check ==# ord_c)
    In the expression:
      if (offset >=# 0#) && (check ==# ord_c) then
          alexIndexInt16OffAddr alex_table offset
      else
          alexIndexInt16OffAddr alex_deflt s

dist/build/alex/alex-tmp/Scan.hs:349:48:
    Couldn't match expected type ‛Bool’ with actual type ‛Int#’
    In the second argument of ‛(&&)’, namely ‛(check ==# ord_c)’
    In the expression: (offset >=# 0#) && (check ==# ord_c)
    In the expression:
      if (offset >=# 0#) && (check ==# ord_c) then
          alexIndexInt16OffAddr alex_table offset
      else
          alexIndexInt16OffAddr alex_deflt s

src/Scan.x:152:2:
    No instance for (Num a0) arising from a use of ‛go’
    The type variable ‛a0’ is ambiguous
    Note: there are several potential instances:
      instance Num Double -- Defined in ‛GHC.Float’
      instance Num Float -- Defined in ‛GHC.Float’
      instance Integral a => Num (GHC.Real.Ratio a)
        -- Defined in ‛GHC.Real’
      ...plus 37 others
    In a stmt of a 'do' block: go inp 1 ""
    In the expression:
      do { inp <- getInput;
           go inp 1 "" }
    In an equation for ‛code’:
        code (p, _, inp) len
          = do { inp <- getInput;
                 go inp 1 "" }
          where
              go inp 0 cs
                = do { setInput inp;
                       .... }
              go inp n cs = do { ... }
              go_char inp n (c1 : c2 : cs)
                | isAlphaNum c2 = go inp n (c1 : c2 : cs)
              go_char inp n cs = go_str inp n cs '\''
              go_str inp n cs end = do { ... }
              err inp
                = do { setInput inp;
                       .... }

schell commented Nov 9, 2013

I'm having this problem as well. Do these all seem related?
simonmar/happy#10
haskell-suite/haskell-src-exts#60

Owner

simonmar commented Nov 10, 2013

I need to re-roll the package to fix this, but my Hackage account is currently disabled for some reason. Fix coming soon, I hope.

Owner

simonmar commented Nov 11, 2013

Now fixed.

@simonmar simonmar closed this Nov 11, 2013

mamash pushed a commit to joyent/pkgsrc-wip that referenced this issue Nov 12, 2013

Update to 3.1.2
Changes in 3.1.2:
    Add missing file to extra-source-files
Changes in 3.1.1:
	Bug fixes (#24, #30, #31, #32)

( #32 => simonmar/alex#32 )
( #31 => simonmar/alex#31 )
( #30 => simonmar/alex#30 )
( #24 => simonmar/alex#24 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment