[GHC] #8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi-line input

GHC ghc-devs at haskell.org
Thu Aug 29 01:14:43 UTC 2013


#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi-
line input
-------------------------------------+------------------------------------
        Reporter:  hvr               |            Owner:
            Type:  bug               |           Status:  patch
        Priority:  highest           |        Milestone:  7.8.1
       Component:  GHCi              |          Version:  7.7
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------
Changes (by thoughtpolice):

 * priority:  normal => highest
 * version:  7.6.3 => 7.7
 * milestone:   => 7.8.1


Comment:

 Herbert, after attempting to merge this patch, it causes two `./validate`
 failures for me:

 {{{
 $ make TEST="ghci023 ghci047"
 =====> ghci023(ghci) 2660 of 3765 [0, 0, 0]
 cd ./ghci/scripts && HC='/home/a/ghc/ghc-pristine/inplace/bin/ghc-stage2'
 HC_OPTS='-dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db
 -rtsopts -fno-ghci-history ' '/home/a/ghc/ghc-pristine/inplace/bin/ghc-
 stage2' --interactive -v0 -ignore-dot-ghci -dcore-lint -dcmm-lint -dno-
 debug-output -no-user-package-db -rtsopts -fno-ghci-history
 <ghci023.script >ghci023.run.stdout 2>ghci023.run.stderr
 Actual stderr output differs from expected:
 --- /dev/null   2013-08-15 19:58:16.771097011 -0500
 +++ ./ghci/scripts/ghci023.run.stderr   2013-08-28 20:06:58.525350140
 -0500
 @@ -0,0 +1,4 @@
 +
 +<interactive>:14:1: parse error on input `:'
 +
 +<interactive>:16:1: parse error on input `:'
 Actual stdout output differs from expected:
 --- ./ghci/scripts/ghci023.stdout       2013-08-22 11:29:40.617737462
 -0500
 +++ ./ghci/scripts/ghci023.run.stdout   2013-08-28 20:06:58.525350140
 -0500
 @@ -1,16 +1,5 @@
  -- testing ghci multiline commands :{ .. :}
  -- via stdin
  (1,2,3)
 -data Maybe a = Nothing | Just a
 -Data.Maybe.catMaybes :: [Maybe a] -> [a]
 -Data.Maybe.fromJust :: Maybe a -> a
 -Data.Maybe.fromMaybe :: a -> Maybe a -> a
 -Data.Maybe.isJust :: Maybe a -> Bool
 -Data.Maybe.isNothing :: Maybe a -> Bool
 -Data.Maybe.listToMaybe :: [a] -> Maybe a
 -Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b]
 -maybe :: b -> (a -> b) -> Maybe a -> b
 -Data.Maybe.maybeToList :: Maybe a -> [a]
  -- via readFile
  (True,False)
 -id :: a -> a
 *** unexpected failure for ghci023(ghci)
 =====> ghci047(ghci) 2684 of 3765 [0, 1, 0]
 cd ./ghci/scripts && HC='/home/a/ghc/ghc-pristine/inplace/bin/ghc-stage2'
 HC_OPTS='-dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db
 -rtsopts -fno-ghci-history ' '/home/a/ghc/ghc-pristine/inplace/bin/ghc-
 stage2' --interactive -v0 -ignore-dot-ghci -dcore-lint -dcmm-lint -dno-
 debug-output -no-user-package-db -rtsopts -fno-ghci-history
 <ghci047.script >ghci047.run.stdout 2>ghci047.run.stderr
 Actual stderr output differs from expected:
 --- ./ghci/scripts/ghci047.stderr       2013-08-22 11:29:40.617737462
 -0500
 +++ ./ghci/scripts/ghci047.run.stderr   2013-08-28 20:06:58.701349185
 -0500
 @@ -1,16 +1,29 @@

 -<interactive>:38:1:
 -    Couldn't match type ‛HFalse’ with ‛HTrue’
 -    Expected type: HTrue
 -      Actual type: Or HFalse HFalse
 -    In the expression: f
 -    In the expression: f $ Baz 'a'
 -    In an equation for ‛it’: it = f $ Baz 'a'
 -
 -<interactive>:39:1:
 -    Couldn't match type ‛HFalse’ with ‛HTrue’
 -    Expected type: HTrue
 -      Actual type: Or HFalse HFalse
 -    In the expression: f
 -    In the expression: f $ Quz
 -    In an equation for ‛it’: it = f $ Quz
 +<interactive>:14:1: parse error on input `data'
 +
 +<interactive>:35:58:
 +    Not in scope: type constructor or class ‛ABorC’
 +
 +<interactive>:36:1: Not in scope: ‛f’
 +
 +<interactive>:36:5: Not in scope: data constructor ‛Foo’
 +
 +<interactive>:37:1: Not in scope: ‛f’
 +
 +<interactive>:37:5: Not in scope: data constructor ‛Bar’
 +
 +<interactive>:38:1: Not in scope: ‛f’
 +
 +<interactive>:38:5: Not in scope: data constructor ‛Baz’
 +
 +<interactive>:39:1: Not in scope: ‛f’
 +
 +<interactive>:39:5: Not in scope: data constructor ‛Quz’
 +
 +<interactive>:40:1: Not in scope: ‛f’
 +
 +<interactive>:40:5: Not in scope: data constructor ‛Yud’
 +
 +<interactive>:41:1: Not in scope: ‛f’
 +
 +<interactive>:41:5: Not in scope: data constructor ‛Myp’
 Actual stdout output differs from expected:
 --- ./ghci/scripts/ghci047.stdout       2013-08-22 11:29:40.617737462
 -0500
 +++ ./ghci/scripts/ghci047.run.stdout   2013-08-28 20:06:58.585349815
 -0500
 @@ -1,4 +0,0 @@
 -1
 -1
 -1
 -1
 *** unexpected failure for ghci047(ghci)

 Unexpected results from:
 TEST="ghci023 ghci047"

 OVERALL SUMMARY for test run started at Wed Aug 28 20:06:57 CDT 2013
     3765 total tests, which gave rise to
    14933 test cases, of which
    14931 were skipped

        0 had missing libraries
        0 expected passes
        0 expected failures

        0 caused framework failures
        0 unexpected passes
        2 unexpected failures

 Unexpected failures:
    ghci/scripts  ghci023 [bad stderr] (ghci)
    ghci/scripts  ghci047 [bad stderr] (ghci)
 }}}

 Can you examine please? The failure to parse `data A` in `ghci047.script`
 seems to indicate to me this is a real failure or some very strange
 behavioral difference I don't understand at a glance.

 This bug also needs to be fixed for 7.8.1 for certain.

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




More information about the ghc-tickets mailing list