[GHC] #13075: Top-level bang pattern accepted
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When I compile/link {{{#!hs {-# LANGUAGE BangPatterns #-} module Main where !(Just x) = Nothing main = putStrLn "hi there!" }}} I get {{{ rae:09:50:49 ~/temp> ghc Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Linking Bug ... ld: can't open output file for writing: Bug, errno=21 for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) `gcc' failed in phase `Linker'. (Exit code: 1) }}} This bogus code should be rejected more gracefully (and earlier). It actually also loads into GHCi, but shouldn't. Will fix while I'm in the area. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Gosh I'm silly. The linker error is just because I have a directory named `Bug` in the same place as `Bug.hs`. I should learn to actually read error messages. I still think the program is utterly bogus. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * component: Compiler => Compiler (Parser) * milestone: => 8.2.1 Comment: Indeed, the program is bogus, because we have no notion of "module load time" in Haskell. It might be nice if we did, but we don't. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <rae@…>): In [changeset:"e7985ed23ddc68b6a2e4af753578dc1d9e8ab4c9/ghc" e7985ed2/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e7985ed23ddc68b6a2e4af753578dc1d9e8ab4c9" Update levity polymorphism This commit implements the proposal in https://github.com/ghc-proposals/ghc-proposals/pull/29 and https://github.com/ghc-proposals/ghc-proposals/pull/35. Here are some of the pieces of that proposal: * Some of RuntimeRep's constructors have been shortened. * TupleRep and SumRep are now parameterized over a list of RuntimeReps. * This means that two types with the same kind surely have the same representation. Previously, all unboxed tuples had the same kind, and thus the fact above was false. * RepType.typePrimRep and friends now return a *list* of PrimReps. These functions can now work successfully on unboxed tuples. This change is necessary because we allow abstraction over unboxed tuple types and so cannot always handle unboxed tuples specially as we did before. * We sometimes have to create an Id from a PrimRep. I thus split PtrRep * into LiftedRep and UnliftedRep, so that the created Ids have the right strictness. * The RepType.RepType type was removed, as it didn't seem to help with * much. * The RepType.repType function is also removed, in favor of typePrimRep. * I have waffled a good deal on whether or not to keep VoidRep in TyCon.PrimRep. In the end, I decided to keep it there. PrimRep is *not* represented in RuntimeRep, and typePrimRep will never return a list including VoidRep. But it's handy to have in, e.g., ByteCodeGen and friends. I can imagine another design choice where we have a PrimRepV type that is PrimRep with an extra constructor. That seemed to be a heavier design, though, and I'm not sure what the benefit would be. * The last, unused vestiges of # (unliftedTypeKind) have been removed. * There were several pretty-printing bugs that this change exposed; * these are fixed. * We previously checked for levity polymorphism in the types of binders. * But we also must exclude levity polymorphism in function arguments. This is hard to check for, requiring a good deal of care in the desugarer. See Note [Levity polymorphism checking] in DsMonad. * In order to efficiently check for levity polymorphism in functions, it * was necessary to add a new bit of IdInfo. See Note [Levity info] in IdInfo. * It is now safe for unlifted types to be unsaturated in Core. Core Lint * is updated accordingly. * We can only know strictness after zonking, so several checks around * strictness in the type-checker (checkStrictBinds, the check for unlifted variables under a ~ pattern) have been moved to the desugarer. * Along the way, I improved the treatment of unlifted vs. banged * bindings. See Note [Strict binds checks] in DsBinds and #13075. * Now that we print type-checked source, we must be careful to print * ConLikes correctly. This is facilitated by a new HsConLikeOut constructor to HsExpr. Particularly troublesome are unlifted pattern synonyms that get an extra void# argument. * Includes a submodule update for haddock, getting rid of #. * New testcases: typecheck/should_fail/StrictBinds typecheck/should_fail/T12973 typecheck/should_run/StrictPats typecheck/should_run/T12809 typecheck/should_fail/T13105 patsyn/should_fail/UnliftedPSBind typecheck/should_fail/LevPolyBounded typecheck/should_compile/T12987 typecheck/should_compile/T11736 * Fixed tickets: #12809 #12973 #11736 #13075 #12987 * This also adds a test case for #13105. This test case is * "compile_fail" and succeeds, because I want the testsuite to monitor the error message. When #13105 is fixed, the test case will compile cleanly. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/StrictBinds Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * testcase: => typecheck/should_fail/StrictBinds * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/StrictBinds Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: goldfire => (none) * status: closed => new * resolution: fixed => Comment: But top-level banged patterns (as in the example program in the ticket) are still accepted, despite the new note `[Strict binds checks]` and existing documentation to the contrary. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: typecheck/should_fail/StrictBinds => typecheck/should_fail/T13075 Comment: In fact, it's not clear that the `StrictBinds` test actually tests this issue at all. I've added the program in the ticket description as `T13075`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"868bdcc8f152935803f6ff133766719ada077bdb/ghc" 868bdcc/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="868bdcc8f152935803f6ff133766719ada077bdb" testsuite: Add testcase for #13075 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"f799df59d5f7e9fb683f2c71e25b65412afc53a7/ghc" f799df5/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="f799df59d5f7e9fb683f2c71e25b65412afc53a7" testsuite: Mark T13075 as broken due to #13075 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The code in question here is likely `DsBinds. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.2.2 Comment: I'm going to bump this off to 8.2.2 as it's a rather minor issue. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.2 => 8.4.1 Comment: Perhaps actually 8.4.1 would be more appropriate as it's not a regression. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sighingnow): This ticket has already been fixed in [changeset:"af89d6872da2e00be738e1ac541346cd84e6d141/ghc"] {{{ Reject top-level banged bindings Bizarrely, we were not rejecting !x = e Fix: * In the test in DsBinds.dsTopLHsBinds, use isBangedHsBind, not isBangedPatBind. (Indeed the latter dies altogther.) * Implement isBangedHsBind in HsUtils; be sure to handle AbsBinds All this was shown up by Trac #13594 }}} We should mark testcase T13075 as normal and add it's stderr. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:13> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"3dec9236a80299cd3e3b9b21a42f91628db1a3d7/ghc" 3dec9236/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="3dec9236a80299cd3e3b9b21a42f91628db1a3d7" Test for Trac #13075 is working now }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:14> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"b2996f1b81c6c51eedc7ece93de0a6bc0426da5c/ghc" b2996f1b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b2996f1b81c6c51eedc7ece93de0a6bc0426da5c" Fix test for Trac #13075 I'd put the stderr file in my link tree, not in the source tree, so my original push had the wrong file, even though my tree validated. Sorry! }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:15> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13075: Top-level bang pattern accepted -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T13075 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed Comment: Done! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13075#comment:16> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC