[GHC] #11637: single-module recursion and import aliases

#11637: single-module recursion and import aliases -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 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: -------------------------------------+------------------------------------- I put the following code in {{{Foo.hs}}}: {{{ module Foo where import Prelude (Either(..)) import {-# SOURCE #-} Foo as F not (Left x) = x not (Right x) = F.not (Left x) }}} And the following code in {{{Foo.hs-boot}}}: {{{ module Foo where import Prelude(Either) not :: Either a a -> a }}} I get the following error when trying to compile: {{{ % ghc -c Foo.hs-boot % ghc -c Foo.hs Foo.hs:5:17: Not in scope: ‘F.not’ zsh: exit 1 ghc -c Foo.hs }}} This surprises me, as running ghci on a slightly modified version (replacing {{{F.not (Left x)}}} with simply {{{x}}}) confirms that `not` is exported correctly; hence I believe {{{F.not}}} should indeed be in scope. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11637 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11637: single-module recursion and import aliases -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 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 ezyang): We disabled self-boot imports in GHC 8.0, in part because cases like this didn't work and would be annoying to make work: {{{ ezyang@sabre:~$ ghc-8.0 --make Foo.hs [1 of 2] Compiling Foo[boot] ( Foo.hs-boot, Foo.o-boot ) [2 of 2] Compiling Foo ( Foo.hs, Foo.o ) Foo.hs:3:1: error: A module cannot import itself: Foo }}} Is this something you can easily work around, or something you quite need? If it's the latter, we can reconsider how to make this work out correctly (but the fix is nontriival.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11637#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11637: single-module recursion and import aliases -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 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 ezyang): See also: #10336 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11637#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11637: single-module recursion and import aliases -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: duplicate | 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 dmwit): * status: new => closed * resolution: => duplicate Comment: Looks like an exact duplicate to me. I don't need this for anything; I encountered the problem while trying to write an answer to [http://stackoverflow.com/q/35608734/791604 a StackOverflow question]. I'll let people who spot that question and make their way here speak for themselves (on the suggested dupe). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11637#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11637: single-module recursion and import aliases -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 10336 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * blockedby: => 10336 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11637#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC