Commit 018676c7 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Use U+2018 instead of U+201B quote mark in compiler messages

This matches GCC's choice of Unicode quotation marks (i.e. U+2018 and U+2019)
and therefore looks more familiar on the console. This addresses #2507.
Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent ede5b518
......@@ -1281,7 +1281,7 @@ initDynFlags dflags = do
refRtccInfo <- newIORef Nothing
wrapperNum <- newIORef emptyModuleEnv
canUseUnicodeQuotes <- do let enc = localeEncoding
str = "’"
str = "’"
(withCString enc str $ \cstr ->
do str' <- peekCString enc cstr
return (str == str'))
......
......@@ -830,7 +830,7 @@ as if there was an "import qualified M" declaration for every
module.
If we fail we just return Nothing, rather than bleating
about "attempting to use module D’ (./D.hs) which is not loaded"
about "attempting to use module D’ (./D.hs) which is not loaded"
which is what loadSrcInterface does.
Note [Safe Haskell and GHCi]
......
......@@ -460,7 +460,7 @@ cparen b d = SDoc $ Pretty.cparen b . runSDoc d
quotes d =
sdocWithDynFlags $ \dflags ->
if useUnicodeQuotes dflags
then char '' <> d <> char '’'
then char '' <> d <> char '’'
else SDoc $ \sty ->
let pp_d = runSDoc d sty
str = show pp_d
......
annfail01.hs:4:1:
Not in scope: type constructor or class Foo’
Not in scope: type constructor or class Foo’
In the annotation: {-# ANN type Foo (1 :: Int) #-}
annfail01.hs:5:1:
Not in scope: f’
Not in scope: f’
In the annotation: {-# ANN f (1 :: Int) #-}
annfail02.hs:6:1:
Not in scope: data constructor Foo’
Not in scope: data constructor Foo’
In the annotation: {-# ANN Foo (1 :: Int) #-}
annfail02.hs:7:1:
Not in scope: type constructor or class Bar’
Not in scope: type constructor or class Bar’
In the annotation: {-# ANN type Bar (2 :: Int) #-}
annfail03.hs:17:11:
GHC stage restriction:
InModule’ is used in a top-level splice or annotation,
InModule’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In the annotation: {-# ANN f InModule #-}
annfail04.hs:14:12:
GHC stage restriction:
instance for Thing
instance for Thing
Int’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In the annotation: {-# ANN f (thing :: Int) #-}
annfail06.hs:22:1:
GHC stage restriction:
instance for Data
instance for Data
InstancesInWrongModule’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In the annotation: {-# ANN f InstancesInWrongModule #-}
annfail07.hs:9:17:
Couldn't match expected type ‛[a0]’ with actual type ‛Bool’
In the first argument of ‛head’, namely ‛True’
Couldn't match expected type ‘[a0]’ with actual type ‘Bool’
In the first argument of ‘head’, namely ‘True’
In the annotation: {-# ANN f (head True) #-}
......@@ -5,5 +5,5 @@ annfail08.hs:9:1:
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:15:
No instance for (Num (a0 -> a0)) arising from a use of +’
No instance for (Num (a0 -> a0)) arising from a use of +’
In the annotation: {-# ANN f (id + 1) #-}
annfail09.hs:11:11:
GHC stage restriction:
g’ is used in a top-level splice or annotation,
g’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In the annotation: {-# ANN f g #-}
annfail10.hs:9:1:
No instance for (Data.Data.Data a0) arising from an annotation
The type variable a0’ is ambiguous
The type variable a0’ is ambiguous
Note: there are several potential instances:
instance Data.Data.Data () -- Defined in Data.Data’
instance Data.Data.Data () -- Defined in Data.Data’
instance (Data.Data.Data a, Data.Data.Data b) =>
Data.Data.Data (a, b)
-- Defined in Data.Data’
-- Defined in Data.Data’
instance (Data.Data.Data a, Data.Data.Data b, Data.Data.Data c) =>
Data.Data.Data (a, b, c)
-- Defined in Data.Data’
-- Defined in Data.Data’
...plus 31 others
In the annotation: {-# ANN f 1 #-}
annfail10.hs:9:11:
No instance for (Num a0) arising from the literal 1’
The type variable a0’ is ambiguous
No instance for (Num a0) arising from the literal 1’
The type variable a0’ is ambiguous
Note: there are several potential instances:
instance Num Double -- Defined in GHC.Float’
instance Num Float -- Defined in GHC.Float’
instance Num Double -- Defined in GHC.Float’
instance Num Float -- Defined in GHC.Float’
instance Integral a => Num (GHC.Real.Ratio a)
-- Defined in GHC.Real’
-- Defined in GHC.Real’
...plus 11 others
In the annotation: {-# ANN f 1 #-}
annfail11.hs:3:1:
Not in scope: length’
Not in scope: length’
In the annotation:
{-# ANN length "Cannot annotate other modules yet" #-}
annfail11.hs:4:1:
Not in scope: type constructor or class Integer’
Not in scope: type constructor or class Integer’
In the annotation:
{-# ANN type Integer "Cannot annotate other modules yet" #-}
annfail13.hs:4:14: parse error on input 1’
annfail13.hs:4:14: parse error on input 1’
T5380.hs:7:27:
Couldn't match expected type ‛Bool’ with actual type ‛not_bool’
not_bool’ is a rigid type variable bound by
Couldn't match expected type ‘Bool’ with actual type ‘not_bool’
not_bool’ is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
......@@ -13,8 +13,8 @@ T5380.hs:7:27:
In the expression: proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type ‛not_unit’ with ‛()’
not_unit’ is a rigid type variable bound by
Couldn't match type ‘not_unit’ with ‘()’
not_unit’ is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
......
arrowfail001.hs:16:36:
No instance for (Foo a) arising from a use of foo’
No instance for (Foo a) arising from a use of foo’
In the expression: foo
In the expression: proc x -> case x of { Bar a -> foo -< a }
In an equation for get’:
In an equation for get’:
get = proc x -> case x of { Bar a -> foo -< a }
arrowfail002.hs:6:17: Not in scope: x’
arrowfail002.hs:6:17: Not in scope: x’
......@@ -3,5 +3,5 @@ arrowfail004.hs:12:15:
Proc patterns cannot use existential or GADT data constructors
In the pattern: T x
In the expression: proc (T x) -> do { returnA -< T x }
In an equation for panic’:
In an equation for panic’:
panic = proc (T x) -> do { returnA -< T x }
GadtOverlap.hs:19:1: Warning:
Pattern match(es) are non-exhaustive
In an equation for h’: Patterns not matched: T3
In an equation for h’: Patterns not matched: T3
T2395.hs:12:1: Warning:
Pattern match(es) are overlapped
In an equation for bar’: bar _ = ...
In an equation for bar’: bar _ = ...
T3263-1.hs:25:3: Warning:
A do-notation statement discarded a result of type Int’
Suppress this warning by saying _ <- nonNullM’
A do-notation statement discarded a result of type Int’
Suppress this warning by saying _ <- nonNullM’
or by using the flag -fno-warn-unused-do-bind
T3263-1.hs:35:3: Warning:
A do-notation statement discarded a result of type Int’
Suppress this warning by saying _ <- nonNullM’
A do-notation statement discarded a result of type Int’
Suppress this warning by saying _ <- nonNullM’
or by using the flag -fno-warn-unused-do-bind
T3263-2.hs:25:3: Warning:
A do-notation statement discarded a result of type m Int’
Suppress this warning by saying _ <- return (return 10 :: m Int)’
A do-notation statement discarded a result of type m Int’
Suppress this warning by saying _ <- return (return 10 :: m Int)’
or by using the flag -fno-warn-wrong-do-bind
T3263-2.hs:37:3: Warning:
A do-notation statement discarded a result of type m Int’
Suppress this warning by saying _ <- return (return 10 :: m Int)’
A do-notation statement discarded a result of type m Int’
Suppress this warning by saying _ <- return (return 10 :: m Int)’
or by using the flag -fno-warn-wrong-do-bind