diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2015-07-17 00:06:28 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-07-17 00:08:10 +0200 |
commit | a5e9da8feb5110ab8ee8fe3821e6b6d53946f983 (patch) | |
tree | ec6959c47ef3eb67bec380b09a9e661c51e82f79 | |
parent | 2c9de9c9a3df8e855c883139b0cb2fd41801bd67 (diff) | |
download | haskell-a5e9da8feb5110ab8ee8fe3821e6b6d53946f983.tar.gz |
Fix off-by-one error in GHCi line reporting (Trac #10578)
Test Plan: I couldn't add tests because apparently line number
reporting was already working correctly when loading script files. I
don't know how to test by running commands using stdin, is this
supported?
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: hvr, thomie
Differential Revision: https://phabricator.haskell.org/D1067
48 files changed, 130 insertions, 127 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index cd58fc2fff..d834523cff 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -424,7 +424,10 @@ interactiveUI config srcs maybe_exprs = do stop = default_stop, editor = default_editor, options = [], - line_number = 1, + -- We initialize line number as 0, not 1, because we use + -- current line number while reporting errors which is + -- incremented after reading a line. + line_number = 0, break_ctr = 0, breaks = [], tickarrays = emptyModuleEnv, @@ -536,7 +539,7 @@ runGHCi paths maybe_exprs = do let show_prompt = verbosity dflags > 0 || is_tty -- reset line number - modifyGHCiState $ \st -> st{line_number=1} + modifyGHCiState $ \st -> st{line_number=0} case maybe_exprs of Nothing -> @@ -745,7 +748,7 @@ runCommands' eh sourceErrorHandler gCmd = gmask $ \unmask -> do case b of Nothing -> return Nothing Just success -> do - when (not success) $ maybe (return ()) lift sourceErrorHandler + unless success $ maybe (return ()) lift sourceErrorHandler unmask $ runCommands' eh sourceErrorHandler gCmd -- | Evaluate a single line of user input (either :<command> or Haskell code). diff --git a/testsuite/tests/ghci.debugger/scripts/break003.stderr b/testsuite/tests/ghci.debugger/scripts/break003.stderr index 00d4237e49..bf3d2ef5a4 100644 --- a/testsuite/tests/ghci.debugger/scripts/break003.stderr +++ b/testsuite/tests/ghci.debugger/scripts/break003.stderr @@ -1,5 +1,5 @@ -<interactive>:5:1: error: +<interactive>:4:1: error: No instance for (Show (t -> t1)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci.debugger/scripts/break006.stderr b/testsuite/tests/ghci.debugger/scripts/break006.stderr index 8a90905260..9822dd785b 100644 --- a/testsuite/tests/ghci.debugger/scripts/break006.stderr +++ b/testsuite/tests/ghci.debugger/scripts/break006.stderr @@ -1,9 +1,9 @@ -<interactive>:6:1:
+<interactive>:5:1:
No instance for (Show t1) arising from a use of ‘print’
Cannot resolve unknown runtime type ‘t1’
Use :print or :force to determine these types
- Relevant bindings include it :: t1 (bound at <interactive>:6:1)
+ Relevant bindings include it :: t1 (bound at <interactive>:5:1)
Note: there are several potential instances:
instance (Show a, Show b) => Show (Either a b)
-- Defined in ‘Data.Either’
@@ -15,11 +15,11 @@ ...plus 33 others
In a stmt of an interactive GHCi command: print it
-<interactive>:8:1:
+<interactive>:7:1:
No instance for (Show t1) arising from a use of ‘print’
Cannot resolve unknown runtime type ‘t1’
Use :print or :force to determine these types
- Relevant bindings include it :: t1 (bound at <interactive>:8:1)
+ Relevant bindings include it :: t1 (bound at <interactive>:7:1)
Note: there are several potential instances:
instance (Show a, Show b) => Show (Either a b)
-- Defined in ‘Data.Either’
diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr index 0c92dba4e4..15c9f839db 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stderr +++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr @@ -1,9 +1,9 @@ -<interactive>:11:1: +<interactive>:10:1: No instance for (Show a1) arising from a use of ‘print’ Cannot resolve unknown runtime type ‘a1’ Use :print or :force to determine these types - Relevant bindings include it :: a1 (bound at <interactive>:11:1) + Relevant bindings include it :: a1 (bound at <interactive>:10:1) Note: there are several potential instances: instance Show TyCon -- Defined in ‘Data.Typeable.Internal’ instance Show TypeRep -- Defined in ‘Data.Typeable.Internal’ diff --git a/testsuite/tests/ghci/prog009/ghci.prog009.stderr b/testsuite/tests/ghci/prog009/ghci.prog009.stderr index 2ad634d746..b2072f6413 100644 --- a/testsuite/tests/ghci/prog009/ghci.prog009.stderr +++ b/testsuite/tests/ghci/prog009/ghci.prog009.stderr @@ -1,7 +1,7 @@ A.hs:1:16: error: parse error on input ‘where’
-<interactive>:26:1: error:
+<interactive>:25:1: error:
Variable not in scope: yan
Perhaps you meant ‘tan’ (imported from Prelude)
diff --git a/testsuite/tests/ghci/prog013/prog013.stderr b/testsuite/tests/ghci/prog013/prog013.stderr index ce8827f6ca..a1b5651c9e 100644 --- a/testsuite/tests/ghci/prog013/prog013.stderr +++ b/testsuite/tests/ghci/prog013/prog013.stderr @@ -8,7 +8,7 @@ Bad.hs:3:8: error: Bad.hs:3:8: error: lexical error in string/character literal at character '\n' -<interactive>:10:1: error: parse error on input ‘+’ +<interactive>:9:1: error: parse error on input ‘+’ Bad.hs:3:8: error: lexical error in string/character literal at character '\n' diff --git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr index b5b3373489..4a92236b38 100644 --- a/testsuite/tests/ghci/scripts/Defer02.stderr +++ b/testsuite/tests/ghci/scripts/Defer02.stderr @@ -128,7 +128,7 @@ In an equation for ‘b’: b x = x == x (deferred type error) -<interactive>:8:11: error: +<interactive>:7:11: error: Couldn't match type ‘Bool’ with ‘Int’ Expected type: C Int Actual type: C Bool @@ -175,7 +175,7 @@ In an equation for ‘j’: j = myOp 23 (deferred type error) -<interactive>:14:8: error: +<interactive>:13:8: error: Couldn't match expected type ‘Bool’ with actual type ‘Int’ In the first argument of ‘print’, namely ‘(k 2)’ In the expression: print (k 2) diff --git a/testsuite/tests/ghci/scripts/T10248.stderr b/testsuite/tests/ghci/scripts/T10248.stderr index b54412ebc8..59b0b29078 100644 --- a/testsuite/tests/ghci/scripts/T10248.stderr +++ b/testsuite/tests/ghci/scripts/T10248.stderr @@ -1,12 +1,12 @@ -<interactive>:3:10: warning:
+<interactive>:2:10: warning:
Found hole: _ :: IO ()
In the second argument of ‘(<$>)’, namely ‘_’
In the first argument of ‘ghciStepIO :: IO a -> IO a’, namely
‘Just <$> _’
In a stmt of an interactive GHCi command:
it <- ghciStepIO :: IO a -> IO a (Just <$> _)
-*** Exception: <interactive>:3:10: error:
+*** Exception: <interactive>:2:10: error:
Found hole: _ :: IO ()
In the second argument of ‘(<$>)’, namely ‘_’
In the first argument of ‘ghciStepIO :: IO a -> IO a’, namely
diff --git a/testsuite/tests/ghci/scripts/T2182ghci.stderr b/testsuite/tests/ghci/scripts/T2182ghci.stderr index 470e72945d..f5eafdfc88 100644 --- a/testsuite/tests/ghci/scripts/T2182ghci.stderr +++ b/testsuite/tests/ghci/scripts/T2182ghci.stderr @@ -1,25 +1,25 @@ -<interactive>:3:1: error: +<interactive>:2:1: error: No instance for (Show (t0 -> t0)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it -<interactive>:11:1: error: +<interactive>:10:1: error: No instance for (Show (t0 -> t0)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it -<interactive>:20:1: error: +<interactive>:19:1: error: No instance for (Show (t0 -> t0)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it -<interactive>:29:1: error: +<interactive>:28:1: error: No instance for (Show (t0 -> t0)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it -<interactive>:50:1: error: +<interactive>:49:1: error: No instance for (Show (t0 -> t0)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci/scripts/T2182ghci2.stderr b/testsuite/tests/ghci/scripts/T2182ghci2.stderr index f850e1d7b4..fde88e3c8a 100644 --- a/testsuite/tests/ghci/scripts/T2182ghci2.stderr +++ b/testsuite/tests/ghci/scripts/T2182ghci2.stderr @@ -1,8 +1,8 @@ -<interactive>:8:1:
+<interactive>:7:1:
No instance for (Show Float) arising from a use of ‘print’
In a stmt of an interactive GHCi command: print it
-<interactive>:16:1:
+<interactive>:15:1:
No instance for (Show Float) arising from a use of ‘print’
In a stmt of an interactive GHCi command: print it
diff --git a/testsuite/tests/ghci/scripts/T2816.stderr b/testsuite/tests/ghci/scripts/T2816.stderr index 69d8349778..bc9fa44254 100644 --- a/testsuite/tests/ghci/scripts/T2816.stderr +++ b/testsuite/tests/ghci/scripts/T2816.stderr @@ -1,2 +1,2 @@ -<interactive>:2:1: error: Variable not in scope: α
+<interactive>:1:1: error: Variable not in scope: α
diff --git a/testsuite/tests/ghci/scripts/T4127a.stderr b/testsuite/tests/ghci/scripts/T4127a.stderr index 58d1bb683e..829ae2f8ca 100644 --- a/testsuite/tests/ghci/scripts/T4127a.stderr +++ b/testsuite/tests/ghci/scripts/T4127a.stderr @@ -1,8 +1,8 @@ -<interactive>:3:68: +<interactive>:2:68: Multiple declarations of ‘f’ - Declared at: <interactive>:3:32 - <interactive>:3:68 + Declared at: <interactive>:2:32 + <interactive>:2:68 In the Template Haskell quotation [d| f = undefined class Foo x where diff --git a/testsuite/tests/ghci/scripts/T5564.stderr b/testsuite/tests/ghci/scripts/T5564.stderr index 309ff1e76c..a63bcc8a95 100644 --- a/testsuite/tests/ghci/scripts/T5564.stderr +++ b/testsuite/tests/ghci/scripts/T5564.stderr @@ -1,10 +1,10 @@ -<interactive>:3:1: error:
+<interactive>:2:1: error:
Variable not in scope: git
- Perhaps you meant ‘it’ (line 2)
+ Perhaps you meant ‘it’ (line 1)
-<interactive>:5:1: error:
+<interactive>:4:1: error:
Variable not in scope: fit
Perhaps you meant one of these:
‘fst’ (imported from Prelude), ‘Ghci1.it’ (imported from Ghci1),
- ‘it’ (line 4)
+ ‘it’ (line 3)
diff --git a/testsuite/tests/ghci/scripts/T6027ghci.stdout b/testsuite/tests/ghci/scripts/T6027ghci.stdout index 2cc6934ea7..be1034b0c7 100644 --- a/testsuite/tests/ghci/scripts/T6027ghci.stdout +++ b/testsuite/tests/ghci/scripts/T6027ghci.stdout @@ -1 +1 @@ -data (?) -- Defined at <interactive>:3:1 +data (?) -- Defined at <interactive>:2:1 diff --git a/testsuite/tests/ghci/scripts/T7730.stdout b/testsuite/tests/ghci/scripts/T7730.stdout index e3a08c19f4..d91d058e53 100644 --- a/testsuite/tests/ghci/scripts/T7730.stdout +++ b/testsuite/tests/ghci/scripts/T7730.stdout @@ -1,8 +1,8 @@ type role A phantom phantom data A (x :: k) (y :: k1) - -- Defined at <interactive>:3:1 + -- Defined at <interactive>:2:1 A :: k -> k1 -> * type role T phantom data T (a :: k) where MkT :: forall (k :: BOX) (a :: k) a1. a1 -> T a - -- Defined at <interactive>:7:1 + -- Defined at <interactive>:6:1 diff --git a/testsuite/tests/ghci/scripts/T7872.stdout b/testsuite/tests/ghci/scripts/T7872.stdout index 81d960947c..4c577ce1cd 100644 --- a/testsuite/tests/ghci/scripts/T7872.stdout +++ b/testsuite/tests/ghci/scripts/T7872.stdout @@ -1,2 +1,2 @@ -type T = forall a. a -> a -- Defined at <interactive>:3:1 -data D = MkT (forall b. b -> b) -- Defined at <interactive>:4:1 +type T = forall a. a -> a -- Defined at <interactive>:2:1 +data D = MkT (forall b. b -> b) -- Defined at <interactive>:3:1 diff --git a/testsuite/tests/ghci/scripts/T7873.stdout b/testsuite/tests/ghci/scripts/T7873.stdout index 215757bb69..79a75ec7ea 100644 --- a/testsuite/tests/ghci/scripts/T7873.stdout +++ b/testsuite/tests/ghci/scripts/T7873.stdout @@ -1,7 +1,7 @@ data D1 where MkD1 :: (forall (k1 :: BOX) (p :: k1 -> *) (a :: k1). p a -> Int) -> D1 - -- Defined at <interactive>:3:1 + -- Defined at <interactive>:2:1 data D2 where MkD2 :: (forall (p :: k -> *) (a :: k). p a -> Int) -> D2 - -- Defined at <interactive>:4:1 + -- Defined at <interactive>:3:1 diff --git a/testsuite/tests/ghci/scripts/T8485.stderr b/testsuite/tests/ghci/scripts/T8485.stderr index bbef720fe2..d1c005b9f6 100644 --- a/testsuite/tests/ghci/scripts/T8485.stderr +++ b/testsuite/tests/ghci/scripts/T8485.stderr @@ -1,4 +1,4 @@ -<interactive>:3:11: error: +<interactive>:2:11: error: The role annotation for ‘X’ lacks an accompanying binding (The role annotation must be given where ‘X’ is declared) diff --git a/testsuite/tests/ghci/scripts/T8579.stdout b/testsuite/tests/ghci/scripts/T8579.stdout index 5220e7e37c..2db09d7fd4 100644 --- a/testsuite/tests/ghci/scripts/T8579.stdout +++ b/testsuite/tests/ghci/scripts/T8579.stdout @@ -1,2 +1,2 @@ -data A = Y -- Defined at <interactive>:3:1 -data A = Y -- Defined at <interactive>:3:1 +data A = Y -- Defined at <interactive>:2:1 +data A = Y -- Defined at <interactive>:2:1 diff --git a/testsuite/tests/ghci/scripts/T8649.stderr b/testsuite/tests/ghci/scripts/T8649.stderr index 257b112112..ae766e5aec 100644 --- a/testsuite/tests/ghci/scripts/T8649.stderr +++ b/testsuite/tests/ghci/scripts/T8649.stderr @@ -1,8 +1,8 @@ -<interactive>:5:4: error: +<interactive>:4:4: error: Couldn't match expected type ‘Ghci1.X’ with actual type ‘X’ - NB: ‘X’ is defined at <interactive>:4:1-25 - ‘Ghci1.X’ is defined at <interactive>:2:1-14 + NB: ‘X’ is defined at <interactive>:3:1-25 + ‘Ghci1.X’ is defined at <interactive>:1:1-14 In the first argument of ‘f’, namely ‘(Y 3)’ In the expression: f (Y 3) diff --git a/testsuite/tests/ghci/scripts/T8959.stderr b/testsuite/tests/ghci/scripts/T8959.stderr index b3995c3365..3f5707bd3a 100644 --- a/testsuite/tests/ghci/scripts/T8959.stderr +++ b/testsuite/tests/ghci/scripts/T8959.stderr @@ -3,7 +3,7 @@ Arrow command found where an expression was expected: () >- () -< () >>- () -<< () -<interactive>:7:15: +<interactive>:6:15: Couldn't match expected type ‘()’ with actual type ‘Bool’ In the pattern: True In a stmt of a pattern guard for @@ -15,7 +15,7 @@ Arrow command found where an expression was expected: () ↣ () ↢ () ⤜ () ⤛ () -<interactive>:14:15: +<interactive>:13:15: Couldn't match expected type ‘()’ with actual type ‘Bool’ In the pattern: True In a stmt of a pattern guard for @@ -27,7 +27,7 @@ Arrow command found where an expression was expected: () >- () -< () >>- () -<< () -<interactive>:21:15: +<interactive>:20:15: Couldn't match expected type ‘()’ with actual type ‘Bool’ In the pattern: True In a stmt of a pattern guard for diff --git a/testsuite/tests/ghci/scripts/T9140.stdout b/testsuite/tests/ghci/scripts/T9140.stdout index 401c8741c5..d9520c0960 100644 --- a/testsuite/tests/ghci/scripts/T9140.stdout +++ b/testsuite/tests/ghci/scripts/T9140.stdout @@ -1,10 +1,10 @@ -<interactive>:3:5: +<interactive>:2:5: You can't mix polymorphic and unlifted bindings a = (# 1 #) Probable fix: use a bang pattern -<interactive>:4:5: +<interactive>:3:5: You can't mix polymorphic and unlifted bindings a = (# 1, 3 #) Probable fix: use a bang pattern diff --git a/testsuite/tests/ghci/scripts/T9293.stderr b/testsuite/tests/ghci/scripts/T9293.stderr index a663562a60..8c7ac45202 100644 --- a/testsuite/tests/ghci/scripts/T9293.stderr +++ b/testsuite/tests/ghci/scripts/T9293.stderr @@ -1,5 +1,5 @@ -<interactive>:5:1: error:
+<interactive>:4:1: error:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
diff --git a/testsuite/tests/ghci/scripts/ghci012.stdout b/testsuite/tests/ghci/scripts/ghci012.stdout index d19785b3ee..0fc695c4d1 100644 --- a/testsuite/tests/ghci/scripts/ghci012.stdout +++ b/testsuite/tests/ghci/scripts/ghci012.stdout @@ -1 +1 @@ -($$$) :: [a -> c] -> [a] -> [c] -- Defined at <interactive>:2:8 +($$$) :: [a -> c] -> [a] -> [c] -- Defined at <interactive>:1:8 diff --git a/testsuite/tests/ghci/scripts/ghci040.stdout b/testsuite/tests/ghci/scripts/ghci040.stdout index b440ef499d..d9ebd9c59e 100644 --- a/testsuite/tests/ghci/scripts/ghci040.stdout +++ b/testsuite/tests/ghci/scripts/ghci040.stdout @@ -1 +1 @@ -data Ghci1.T = A | ... -- Defined at <interactive>:3:10 +data Ghci1.T = A | ... -- Defined at <interactive>:2:10 diff --git a/testsuite/tests/ghci/scripts/ghci041.stdout b/testsuite/tests/ghci/scripts/ghci041.stdout index daf48fc25d..14b8726c76 100644 --- a/testsuite/tests/ghci/scripts/ghci041.stdout +++ b/testsuite/tests/ghci/scripts/ghci041.stdout @@ -1 +1 @@ -data R = A | ... -- Defined at <interactive>:4:10 +data R = A | ... -- Defined at <interactive>:3:10 diff --git a/testsuite/tests/ghci/scripts/ghci042.stdout b/testsuite/tests/ghci/scripts/ghci042.stdout index 2a75ecb496..5cb84f632f 100644 --- a/testsuite/tests/ghci/scripts/ghci042.stdout +++ b/testsuite/tests/ghci/scripts/ghci042.stdout @@ -1,6 +1,6 @@ -data T = A {...} -- Defined at <interactive>:3:10 -data T = A {a :: Int} -- Defined at <interactive>:3:13 -a :: Integer -- Defined at <interactive>:6:5 +data T = A {...} -- Defined at <interactive>:2:10 +data T = A {a :: Int} -- Defined at <interactive>:2:13 +a :: Integer -- Defined at <interactive>:5:5 3 -data R = B {a :: Int} -- Defined at <interactive>:9:13 -data T = A {Ghci1.a :: Int} -- Defined at <interactive>:3:1 +data R = B {a :: Int} -- Defined at <interactive>:8:13 +data T = A {Ghci1.a :: Int} -- Defined at <interactive>:2:1 diff --git a/testsuite/tests/ghci/scripts/ghci044.stderr b/testsuite/tests/ghci/scripts/ghci044.stderr index b49978dd39..9ff8acc5c7 100644 --- a/testsuite/tests/ghci/scripts/ghci044.stderr +++ b/testsuite/tests/ghci/scripts/ghci044.stderr @@ -1,8 +1,8 @@ -<interactive>:10:1: error: +<interactive>:9:1: error: Overlapping instances for C [Int] arising from a use of ‘f’ Matching instances: - instance [safe] C [Int] -- Defined at <interactive>:7:10 - instance [safe] C a => C [a] -- Defined at <interactive>:9:10 + instance [safe] C [Int] -- Defined at <interactive>:6:10 + instance [safe] C a => C [a] -- Defined at <interactive>:8:10 In the expression: f [4 :: Int] In an equation for ‘it’: it = f [4 :: Int] diff --git a/testsuite/tests/ghci/scripts/ghci047.stderr b/testsuite/tests/ghci/scripts/ghci047.stderr index 9428dbc1a9..dc8dfc9ecb 100644 --- a/testsuite/tests/ghci/scripts/ghci047.stderr +++ b/testsuite/tests/ghci/scripts/ghci047.stderr @@ -1,5 +1,5 @@ -<interactive>:39:1: +<interactive>:38:1: Couldn't match type ‘HFalse’ with ‘HTrue’ Expected type: HTrue Actual type: Or HFalse HFalse @@ -7,7 +7,7 @@ In the expression: f $ Baz 'a' In an equation for ‘it’: it = f $ Baz 'a' -<interactive>:40:1: +<interactive>:39:1: Couldn't match type ‘HFalse’ with ‘HTrue’ Expected type: HTrue Actual type: Or HFalse HFalse diff --git a/testsuite/tests/ghci/scripts/ghci048.stderr b/testsuite/tests/ghci/scripts/ghci048.stderr index 1b96e5da07..27cc18f708 100644 --- a/testsuite/tests/ghci/scripts/ghci048.stderr +++ b/testsuite/tests/ghci/scripts/ghci048.stderr @@ -1,10 +1,10 @@ -<interactive>:4:16: +<interactive>:3:16: Multiple declarations of ‘A’ - Declared at: <interactive>:4:12 - <interactive>:4:16 + Declared at: <interactive>:3:12 + <interactive>:3:16 -<interactive>:6:16: +<interactive>:5:16: Multiple declarations of ‘A’ - Declared at: <interactive>:6:12 - <interactive>:6:16 + Declared at: <interactive>:5:12 + <interactive>:5:16 diff --git a/testsuite/tests/ghci/scripts/ghci050.stderr b/testsuite/tests/ghci/scripts/ghci050.stderr index d1df9b8379..4b454bd8bf 100644 --- a/testsuite/tests/ghci/scripts/ghci050.stderr +++ b/testsuite/tests/ghci/scripts/ghci050.stderr @@ -1,13 +1,13 @@ -<interactive>:6:49: error: +<interactive>:5:49: error: Couldn't match expected type ‘ListableElem (a, a)’ with actual type ‘a’ ‘a’ is a rigid type variable bound by - the instance declaration at <interactive>:6:10 + the instance declaration at <interactive>:5:10 Relevant bindings include - b :: a (bound at <interactive>:6:43) - a :: a (bound at <interactive>:6:41) + b :: a (bound at <interactive>:5:43) + a :: a (bound at <interactive>:5:41) asList :: (a, a) -> [ListableElem (a, a)] - (bound at <interactive>:6:33) + (bound at <interactive>:5:33) In the expression: a In the expression: [a, b] diff --git a/testsuite/tests/ghci/scripts/ghci051.stderr b/testsuite/tests/ghci/scripts/ghci051.stderr index 2a528e847a..7a33dd57b6 100644 --- a/testsuite/tests/ghci/scripts/ghci051.stderr +++ b/testsuite/tests/ghci/scripts/ghci051.stderr @@ -1,9 +1,9 @@ -<interactive>:7:9: error: +<interactive>:6:9: error: Couldn't match type ‘T’ with ‘Ghci1.T’ - NB: ‘Ghci1.T’ is defined at <interactive>:3:1-14 - ‘T’ is defined at <interactive>:6:1-16 + NB: ‘Ghci1.T’ is defined at <interactive>:2:1-14 + ‘T’ is defined at <interactive>:5:1-16 Expected type: T' Actual type: T In the expression: C :: T' diff --git a/testsuite/tests/ghci/scripts/ghci051.stdout b/testsuite/tests/ghci/scripts/ghci051.stdout index f69b0e2de3..a3542869a5 100644 --- a/testsuite/tests/ghci/scripts/ghci051.stdout +++ b/testsuite/tests/ghci/scripts/ghci051.stdout @@ -1,9 +1,9 @@ -data T = C | D -- Defined at <interactive>:9:1 -type T' = Ghci1.T -- Defined at <interactive>:4:1 -data Ghci1.T = A | ... -- Defined at <interactive>:3:10 -data Ghci4.T = B | ... -- Defined at <interactive>:6:12 -data T = C | ... -- Defined at <interactive>:9:14 -data T = ... | D -- Defined at <interactive>:9:18 -b :: T' -- Defined at <interactive>:5:5 -c :: Ghci4.T -- Defined at <interactive>:8:5 -d :: T -- Defined at <interactive>:10:5 +data T = C | D -- Defined at <interactive>:8:1 +type T' = Ghci1.T -- Defined at <interactive>:3:1 +data Ghci1.T = A | ... -- Defined at <interactive>:2:10 +data Ghci4.T = B | ... -- Defined at <interactive>:5:12 +data T = C | ... -- Defined at <interactive>:8:14 +data T = ... | D -- Defined at <interactive>:8:18 +b :: T' -- Defined at <interactive>:4:5 +c :: Ghci4.T -- Defined at <interactive>:7:5 +d :: T -- Defined at <interactive>:9:5 diff --git a/testsuite/tests/ghci/scripts/ghci052.stderr b/testsuite/tests/ghci/scripts/ghci052.stderr index ce221887d6..4464891168 100644 --- a/testsuite/tests/ghci/scripts/ghci052.stderr +++ b/testsuite/tests/ghci/scripts/ghci052.stderr @@ -1,32 +1,32 @@ -<interactive>:9:4: error: +<interactive>:8:4: error: Couldn't match expected type ‘Ghci1.Planet’ with actual type ‘Planet’ - NB: ‘Planet’ is defined at <interactive>:8:1-36 - ‘Ghci1.Planet’ is defined at <interactive>:5:1-37 + NB: ‘Planet’ is defined at <interactive>:7:1-36 + ‘Ghci1.Planet’ is defined at <interactive>:4:1-37 In the first argument of ‘pn’, namely ‘Mercury’ In the expression: pn Mercury -<interactive>:10:4: error: +<interactive>:9:4: error: Couldn't match expected type ‘Ghci1.Planet’ with actual type ‘Planet’ - NB: ‘Planet’ is defined at <interactive>:8:1-36 - ‘Ghci1.Planet’ is defined at <interactive>:5:1-37 + NB: ‘Planet’ is defined at <interactive>:7:1-36 + ‘Ghci1.Planet’ is defined at <interactive>:4:1-37 In the first argument of ‘pn’, namely ‘Venus’ In the expression: pn Venus -<interactive>:11:4: error: +<interactive>:10:4: error: Couldn't match expected type ‘Ghci1.Planet’ with actual type ‘Planet’ - NB: ‘Planet’ is defined at <interactive>:8:1-36 - ‘Ghci1.Planet’ is defined at <interactive>:5:1-37 + NB: ‘Planet’ is defined at <interactive>:7:1-36 + ‘Ghci1.Planet’ is defined at <interactive>:4:1-37 In the first argument of ‘pn’, namely ‘Mars’ In the expression: pn Mars -<interactive>:13:44: error: +<interactive>:12:44: error: Couldn't match expected type ‘Planet’ with actual type ‘Ghci1.Planet’ - NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-37 - ‘Planet’ is defined at <interactive>:8:1-36 + NB: ‘Ghci1.Planet’ is defined at <interactive>:4:1-37 + ‘Planet’ is defined at <interactive>:7:1-36 In the pattern: Earth In an equation for ‘pn’: pn Earth = "E" diff --git a/testsuite/tests/ghci/scripts/ghci053.stderr b/testsuite/tests/ghci/scripts/ghci053.stderr index fe6d6c9bef..bb038faf23 100644 --- a/testsuite/tests/ghci/scripts/ghci053.stderr +++ b/testsuite/tests/ghci/scripts/ghci053.stderr @@ -1,16 +1,16 @@ -<interactive>:10:12: error: +<interactive>:9:12: error: Couldn't match expected type ‘Ghci1.Planet’ with actual type ‘Planet’ - NB: ‘Planet’ is defined at <interactive>:8:1-41 - ‘Ghci1.Planet’ is defined at <interactive>:5:1-49 + NB: ‘Planet’ is defined at <interactive>:7:1-41 + ‘Ghci1.Planet’ is defined at <interactive>:4:1-49 In the second argument of ‘(==)’, namely ‘Mercury’ In the expression: mercury == Mercury -<interactive>:12:10: error: +<interactive>:11:10: error: Couldn't match expected type ‘Planet’ with actual type ‘Ghci1.Planet’ - NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-49 - ‘Planet’ is defined at <interactive>:8:1-41 + NB: ‘Ghci1.Planet’ is defined at <interactive>:4:1-49 + ‘Planet’ is defined at <interactive>:7:1-41 In the second argument of ‘(==)’, namely ‘Earth’ In the expression: Venus == Earth diff --git a/testsuite/tests/ghci/scripts/ghci057.stderr b/testsuite/tests/ghci/scripts/ghci057.stderr index a663562a60..8c7ac45202 100644 --- a/testsuite/tests/ghci/scripts/ghci057.stderr +++ b/testsuite/tests/ghci/scripts/ghci057.stderr @@ -1,5 +1,5 @@ -<interactive>:5:1: error:
+<interactive>:4:1: error:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
diff --git a/testsuite/tests/ghci/should_run/T9914.stdout b/testsuite/tests/ghci/should_run/T9914.stdout index 3dd5aff3f3..d9407d3877 100644 --- a/testsuite/tests/ghci/should_run/T9914.stdout +++ b/testsuite/tests/ghci/should_run/T9914.stdout @@ -1,5 +1,5 @@ 1 2 2 -data T1 = MkT1 -- Defined at <interactive>:7:1 -data T2 = MkT2 -- Defined at <interactive>:9:2 +data T1 = MkT1 -- Defined at <interactive>:6:1 +data T2 = MkT2 -- Defined at <interactive>:8:2 diff --git a/testsuite/tests/ghci/should_run/T9915.stderr b/testsuite/tests/ghci/should_run/T9915.stderr index 333f17ac81..95f5758517 100644 --- a/testsuite/tests/ghci/should_run/T9915.stderr +++ b/testsuite/tests/ghci/should_run/T9915.stderr @@ -1,5 +1,5 @@ -<interactive>:3:9: error: +<interactive>:2:9: error: parse error on input ‘=’ Perhaps you need a 'let' in a 'do' block? e.g. 'let x = 5' instead of 'x = 5' diff --git a/testsuite/tests/patsyn/should_run/ghci.stderr b/testsuite/tests/patsyn/should_run/ghci.stderr index 9593b15633..9740d06859 100644 --- a/testsuite/tests/patsyn/should_run/ghci.stderr +++ b/testsuite/tests/patsyn/should_run/ghci.stderr @@ -1,2 +1,2 @@ -*** Exception: <interactive>:6:5-35: Non-exhaustive patterns in function foo +*** Exception: <interactive>:5:5-35: Non-exhaustive patterns in function foo diff --git a/testsuite/tests/patsyn/should_run/ghci.stdout b/testsuite/tests/patsyn/should_run/ghci.stdout index e434de3dd6..3dcecbc7a6 100644 --- a/testsuite/tests/patsyn/should_run/ghci.stdout +++ b/testsuite/tests/patsyn/should_run/ghci.stdout @@ -1,3 +1,3 @@ -pattern Single :: t -> [t] -- Defined at <interactive>:4:1 +pattern Single :: t -> [t] -- Defined at <interactive>:3:1 foo :: [Bool] -> [Bool] [False] diff --git a/testsuite/tests/safeHaskell/ghci/p10.stderr b/testsuite/tests/safeHaskell/ghci/p10.stderr index e20f84f241..5104dd6a96 100644 --- a/testsuite/tests/safeHaskell/ghci/p10.stderr +++ b/testsuite/tests/safeHaskell/ghci/p10.stderr @@ -1,2 +1,2 @@ -<interactive>:10:1: error: Variable not in scope: b
+<interactive>:9:1: error: Variable not in scope: b
diff --git a/testsuite/tests/safeHaskell/ghci/p13.stderr b/testsuite/tests/safeHaskell/ghci/p13.stderr index f7e8b8524b..7ba149a36b 100644 --- a/testsuite/tests/safeHaskell/ghci/p13.stderr +++ b/testsuite/tests/safeHaskell/ghci/p13.stderr @@ -1,10 +1,10 @@ -<interactive>:11:1: error: +<interactive>:10:1: error: Unsafe overlapping instances for Pos [Int] arising from a use of ‘res’ The matching instance is: instance [overlapping] [safe] Pos [Int] - -- Defined at <interactive>:9:30 + -- Defined at <interactive>:8:30 It is compiled in a Safe module and as such can only overlap instances from the same module, however it overlaps the following instances from different modules: diff --git a/testsuite/tests/safeHaskell/ghci/p14.stderr b/testsuite/tests/safeHaskell/ghci/p14.stderr index 4d0b14e970..b015016622 100644 --- a/testsuite/tests/safeHaskell/ghci/p14.stderr +++ b/testsuite/tests/safeHaskell/ghci/p14.stderr @@ -1,2 +1,2 @@ -<interactive>:10:1: parse error on input ‘{-# RULES’ +<interactive>:9:1: parse error on input ‘{-# RULES’ diff --git a/testsuite/tests/safeHaskell/ghci/p16.stderr b/testsuite/tests/safeHaskell/ghci/p16.stderr index 9540119eae..e14727bc49 100644 --- a/testsuite/tests/safeHaskell/ghci/p16.stderr +++ b/testsuite/tests/safeHaskell/ghci/p16.stderr @@ -2,14 +2,14 @@ <no location info>: warning:
-XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving
-<interactive>:16:29: error:
+<interactive>:15:29: error:
Can't make a derived instance of ‘Op T2’:
‘Op’ is not a derivable class
Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension
In the newtype declaration for ‘T2’
-<interactive>:19:9: error:
+<interactive>:18:9: error:
Data constructor not in scope: T2 :: T -> t
- Perhaps you meant ‘T1’ (line 13)
+ Perhaps you meant ‘T1’ (line 12)
-<interactive>:22:4: error: Variable not in scope: y
+<interactive>:21:4: error: Variable not in scope: y
diff --git a/testsuite/tests/safeHaskell/ghci/p4.stderr b/testsuite/tests/safeHaskell/ghci/p4.stderr index 2160c00d7d..5d70969f3a 100644 --- a/testsuite/tests/safeHaskell/ghci/p4.stderr +++ b/testsuite/tests/safeHaskell/ghci/p4.stderr @@ -1,8 +1,8 @@ -<interactive>:6:9: error:
+<interactive>:5:9: error:
Not in scope: ‘System.IO.Unsafe.unsafePerformIO’
-<interactive>:7:9: error:
+<interactive>:6:9: error:
Variable not in scope: x :: IO Integer -> t
-<interactive>:8:1: error: Variable not in scope: y
+<interactive>:7:1: error: Variable not in scope: y
diff --git a/testsuite/tests/safeHaskell/ghci/p6.stderr b/testsuite/tests/safeHaskell/ghci/p6.stderr index 83343029d4..8cca54eb2f 100644 --- a/testsuite/tests/safeHaskell/ghci/p6.stderr +++ b/testsuite/tests/safeHaskell/ghci/p6.stderr @@ -1,10 +1,10 @@ -<interactive>:12:1: error:
+<interactive>:11:1: error:
Unacceptable result type in foreign declaration:
Safe Haskell is on, all FFI imports must be in the IO monad
When checking declaration:
foreign import ccall safe "static sin" c_sin :: Double -> Double
-<interactive>:13:1: error:
+<interactive>:12:1: error:
Variable not in scope: c_sin :: Integer -> t
- Perhaps you meant ‘c_sin'’ (line 8)
+ Perhaps you meant ‘c_sin'’ (line 7)
diff --git a/testsuite/tests/safeHaskell/ghci/p9.stderr b/testsuite/tests/safeHaskell/ghci/p9.stderr index e20f84f241..5104dd6a96 100644 --- a/testsuite/tests/safeHaskell/ghci/p9.stderr +++ b/testsuite/tests/safeHaskell/ghci/p9.stderr @@ -1,2 +1,2 @@ -<interactive>:10:1: error: Variable not in scope: b
+<interactive>:9:1: error: Variable not in scope: b
diff --git a/testsuite/tests/th/T7276a.stdout b/testsuite/tests/th/T7276a.stdout index 6aad44f6d5..3e8c4878a8 100644 --- a/testsuite/tests/th/T7276a.stdout +++ b/testsuite/tests/th/T7276a.stdout @@ -1,5 +1,5 @@ -<interactive>:4:9: Warning: +<interactive>:3:9: Warning: Couldn't match type ‘[Dec]’ with ‘Exp’ Expected type: Q Exp Actual type: DecsQ @@ -8,7 +8,7 @@ <interactive>:1:1: Exception when trying to run compile-time code: - <interactive>:4:9: + <interactive>:3:9: Couldn't match type ‘[Dec]’ with ‘Exp’ Expected type: Q Exp Actual type: DecsQ |