[GHC] #11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Given: A.hs {{{#!hs module A where data A = A f :: A -> Bool f C = False }}} A.hs-boot {{{#!hs module A where data A f :: A -> Bool }}} B.hs {{{#!hs module B where import {-# SOURCE #-} A data B = B A g :: B -> Bool g (B a) = f a }}} ghci reports: {{{ $ ghci B.hs GHCi, version 8.0.0.20160411: http://www.haskell.org/ghc/ :? for help [1 of 3] Compiling A[boot] ( A.hs-boot, interpreted ) [2 of 3] Compiling A ( A.hs, interpreted ) A.hs:6:3: error: Not in scope: data constructor ‘C’ *** Exception: expectJust showModule CallStack (from HasCallStack): error, called at compiler/utils/Maybes.hs:48:27 in ghc:Maybes
}}} So instead of a normal error telling me that the C constructor does not exist, I get an additional exception from expectJust because something went wrong in GHCs internal error reporting routine. Looking at https://github.com/ghc/ghc/blob/master/compiler/main/InteractiveEval.hs#L956, the expectJust exception is due to the fact that while reporting an error about A.hs, GHCi somehow got a hold of the ModSummary of A.hs-boot instead of A.hs -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: ezyang (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Edward, might you look at this? (Or declare it out of your scope.) Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by darchon): * cc: ezyang (removed) Comment: Maybe I'm inferring too much, looking at the output of ghc 7.10.3: {{{ $ ghci B.hs GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help B.hs:3:23: Warning: {-# SOURCE #-} unnecessary in import of ‘A’ [1 of 3] Compiling A[boot] ( A.hs-boot, interpreted ) [2 of 3] Compiling A ( A.hs, interpreted ) A.hs:6:3: Not in scope: data constructor ‘C’ Failed, modules loaded: A, A. }}} I see that two 'A' modules are loaded, the first one probably being the A .hs-boot file. So perhaps 'isModuleInterpreted' is not getting "wrong" ModSummary, but it is some other type of regression with regards to reporting errors when hs-boot files are involved. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by darchon): * cc: ezyang (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal
ModSummary
-------------------------------------+-------------------------------------
Reporter: darchon | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 8.0.1-rc3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.1 => 8.0.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal
ModSummary
-------------------------------------+-------------------------------------
Reporter: darchon | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.2
Component: Compiler | Version: 8.0.1-rc3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.3 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.2 => 8.0.3 Comment: It doesn't look like this will get fixed for 8.0.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): I get a Googlelocatably-similar error message with {{{#!hs {-# LANGUAGE PolyKinds, TypeInType #-} import GHC.Exts data A :: TYPE rep -> Constraint }}} using GHC version 8.0.2 {{{ *** Exception: expectJust zonkTcTyVarToVar CallStack (from HasCallStack): error, called at compiler\utils\Maybes.hs:48:27 in ghc:Maybes }}} I can't remember if this has been reported already. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I think this is #13343. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): The panic in comment:9 has been fixed after #13343 was resolved. The original bug in this ticket, however, still occurs. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11827: InteractiveEval error handling gets a boot ModSummary instead of normal ModSummary -------------------------------------+------------------------------------- Reporter: darchon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: ghci/T11827 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => ghci/T11827 * milestone: 8.6.1 => Comment: Removing milestone as no one is actively working on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11827#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC