[GHC] #10824: Strict let-bindings are processed backwards (was: Let-bindings of kind # are processed backwards)

GHC ghc-devs at haskell.org
Fri Sep 4 07:49:03 UTC 2015


#10824: Strict let-bindings are processed backwards
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Description changed by ezyang:

Old description:

> Consider this module:
>
> {{{
> {-# LANGUAGE MagicHash #-}
> import GHC.Exts
> main = do let x = error "bar" :: Int#
>               y = error "foo" :: Int#
>           print (I# x + I# y)
> }}}
>
> When you run this, you will get the error "foo" and not the error "bar".
> This is backwards!

New description:

 Consider this module:

 {{{
 main = do let !x = error "bar"
               !y = error "foo"
           print (x + y)
 }}}
 or this analogous module:

 {{{
 {-# LANGUAGE MagicHash #-}
 import GHC.Exts
 main = do let x = error "bar" :: Int#
               y = error "foo" :: Int#
           print (I# x + I# y)
 }}}

 When you run these, you will get the error "foo" and not the error "bar".
 This is backwards!

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10824#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list