diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-10-07 13:57:59 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-30 07:36:50 -0400 |
commit | 3e7569bcd4a88ba45d2c40b0904c587c2edf4972 (patch) | |
tree | 26fb12e13649adebffd4aa11fe33c51fc68ce28e /testsuite/tests | |
parent | 93ff91978be67920c7e3657c077ca14c5d6c09bc (diff) | |
download | haskell-3e7569bcd4a88ba45d2c40b0904c587c2edf4972.tar.gz |
Whitespace forward compatibility for proposal #229
GHC Proposal #229 changes the lexical rules of Haskell, which may
require slight whitespace adjustments in certain cases.
This patch changes formatting in a few places in GHC and its testsuite
in a way that enables it to compile under the proposed rules.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/ds020.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/determinism/determ017/A.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T3787.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/module/mod70.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/module/mod70.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/T13600b.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/T13600b.stderr | 20 | ||||
-rw-r--r-- | testsuite/tests/programs/strict_anns/Main.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/rnfail016.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T3591.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T11313.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T11313.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T12529.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/tcfail112.hs | 2 |
14 files changed, 23 insertions, 43 deletions
diff --git a/testsuite/tests/deSugar/should_compile/ds020.hs b/testsuite/tests/deSugar/should_compile/ds020.hs index c6d61461c3..a185ff2ce7 100644 --- a/testsuite/tests/deSugar/should_compile/ds020.hs +++ b/testsuite/tests/deSugar/should_compile/ds020.hs @@ -11,7 +11,7 @@ a ~(~[],~[],~[]) = [] b ~(x:xs:ys) = [] b ~(~x: ~xs: ~ys) = [] -c ~x ~ _ ~11111 ~3.14159265 = x +c ~x ~_ ~11111 ~3.14159265 = x d 11 = 4 d 12 = 3 diff --git a/testsuite/tests/determinism/determ017/A.hs b/testsuite/tests/determinism/determ017/A.hs index 082c9380de..f3e3bb9e30 100644 --- a/testsuite/tests/determinism/determ017/A.hs +++ b/testsuite/tests/determinism/determ017/A.hs @@ -85,7 +85,7 @@ instance MonadFail Identity where fail = error "Identity(fail)" newtype Trampoline m s r = Trampoline {bounce :: m (TrampolineState m s r)} -data TrampolineState m s r = Done r | Suspend! (s (Trampoline m s r)) +data TrampolineState m s r = Done r | Suspend !(s (Trampoline m s r)) instance (Monad m, Functor s) => Functor (Trampoline m s) where fmap = liftM @@ -103,11 +103,11 @@ instance (Monad m, Functor s) => Monad (Trampoline m s) where instance (MonadFail m, Functor s) => MonadFail (Trampoline m s) where fail = error "Trampoline(fail)" -data Yield x y = Yield! x y +data Yield x y = Yield !x y instance Functor (Yield x) where fmap f (Yield x y) = trace "fmap yield" $ Yield x (f y) -data Await x y = Await! (x -> y) +data Await x y = Await !(x -> y) instance Functor (Await x) where fmap f (Await g) = trace "fmap await" $ Await (f . g) diff --git a/testsuite/tests/indexed-types/should_compile/T3787.hs b/testsuite/tests/indexed-types/should_compile/T3787.hs index 5e14092611..f438674d7a 100644 --- a/testsuite/tests/indexed-types/should_compile/T3787.hs +++ b/testsuite/tests/indexed-types/should_compile/T3787.hs @@ -76,7 +76,7 @@ data TrampolineState s m r = -- | Trampoline computation is finished with final value /r/. Done r -- | Computation is suspended, its remainder is embedded in the functor /s/. - | Suspend! (s (Trampoline s m r)) + | Suspend !(s (Trampoline s m r)) instance (Functor s, Monad m) => Functor (Trampoline s m) where fmap = liftM @@ -101,11 +101,11 @@ instance (Functor s, ParallelizableMonad m) => ParallelizableMonad (Trampoline s instance Functor s => MonadTrans (Trampoline s) where lift = Trampoline . liftM Done -data Yield x y = Yield! x y +data Yield x y = Yield !x y instance Functor (Yield x) where fmap f (Yield x y) = Yield x (f y) -data Await x y = Await! (x -> y) +data Await x y = Await !(x -> y) instance Functor (Await x) where fmap f (Await g) = Await (f . g) diff --git a/testsuite/tests/module/mod70.hs b/testsuite/tests/module/mod70.hs index cb7d51fe3b..954f39f353 100644 --- a/testsuite/tests/module/mod70.hs +++ b/testsuite/tests/module/mod70.hs @@ -1,3 +1,3 @@ -- !!! Illegal ~ in expression module M where -f x = x~1 +f x = x ~1 diff --git a/testsuite/tests/module/mod70.stderr b/testsuite/tests/module/mod70.stderr index 616ef12376..093f166ebd 100644 --- a/testsuite/tests/module/mod70.stderr +++ b/testsuite/tests/module/mod70.stderr @@ -1,2 +1,2 @@ -mod70.hs:3:8: error: Pattern syntax in expression context: ~1 +mod70.hs:3:9: error: Pattern syntax in expression context: ~1 diff --git a/testsuite/tests/parser/should_compile/T13600b.hs b/testsuite/tests/parser/should_compile/T13600b.hs index e8fd2c183f..14796426e9 100644 --- a/testsuite/tests/parser/should_compile/T13600b.hs +++ b/testsuite/tests/parser/should_compile/T13600b.hs @@ -1,9 +1,9 @@ module T13600b where -f !(Just x) = f !! x -f !y = head f +f ! (Just x) = f !! x +f ! y = head f x = [1,2,3] ! Just 1 where - f !(Just x) = f !! x - f !y = head f + f ! (Just x) = f !! x + f ! y = head f diff --git a/testsuite/tests/parser/should_compile/T13600b.stderr b/testsuite/tests/parser/should_compile/T13600b.stderr deleted file mode 100644 index 244b948e0e..0000000000 --- a/testsuite/tests/parser/should_compile/T13600b.stderr +++ /dev/null @@ -1,20 +0,0 @@ - -T13600b.hs:3:3: warning: [-Wmissing-space-after-bang (in -Wdefault)] - Did you forget to enable BangPatterns? - If you mean to bind (!) then perhaps you want - to add a space after the bang for clarity. - -T13600b.hs:4:3: warning: [-Wmissing-space-after-bang (in -Wdefault)] - Did you forget to enable BangPatterns? - If you mean to bind (!) then perhaps you want - to add a space after the bang for clarity. - -T13600b.hs:8:7: warning: [-Wmissing-space-after-bang (in -Wdefault)] - Did you forget to enable BangPatterns? - If you mean to bind (!) then perhaps you want - to add a space after the bang for clarity. - -T13600b.hs:9:7: warning: [-Wmissing-space-after-bang (in -Wdefault)] - Did you forget to enable BangPatterns? - If you mean to bind (!) then perhaps you want - to add a space after the bang for clarity. diff --git a/testsuite/tests/programs/strict_anns/Main.hs b/testsuite/tests/programs/strict_anns/Main.hs index d9deac65f6..dcd9103fa0 100644 --- a/testsuite/tests/programs/strict_anns/Main.hs +++ b/testsuite/tests/programs/strict_anns/Main.hs @@ -3,9 +3,9 @@ module Main where -data Foo1 = Crunch1 ! Int ! Int Int deriving( Show ) +data Foo1 = Crunch1 !Int !Int Int deriving( Show ) -data Foo2 = Crunch2 ! Int Int Int deriving( Show ) +data Foo2 = Crunch2 !Int Int Int deriving( Show ) main = do print (Crunch1 (1+1) (2+2) (3+3)) diff --git a/testsuite/tests/rename/should_fail/rnfail016.hs b/testsuite/tests/rename/should_fail/rnfail016.hs index 7dccaa90b1..32ac6032bc 100644 --- a/testsuite/tests/rename/should_fail/rnfail016.hs +++ b/testsuite/tests/rename/should_fail/rnfail016.hs @@ -3,5 +3,5 @@ module ShouldFail where -- !!! Pattern syntax in expressions -f x = x @ x +f x = x@x diff --git a/testsuite/tests/simplCore/should_run/T3591.hs b/testsuite/tests/simplCore/should_run/T3591.hs index 6b2b23b2ba..fc49c00cdb 100644 --- a/testsuite/tests/simplCore/should_run/T3591.hs +++ b/testsuite/tests/simplCore/should_run/T3591.hs @@ -83,7 +83,7 @@ instance Monad Identity where m >>= k = k (runIdentity m) newtype Trampoline m s r = Trampoline {bounce :: m (TrampolineState m s r)} -data TrampolineState m s r = Done r | Suspend! (s (Trampoline m s r)) +data TrampolineState m s r = Done r | Suspend !(s (Trampoline m s r)) instance (Monad m, Functor s) => Functor (Trampoline m s) where fmap = liftM @@ -101,11 +101,11 @@ instance (Monad m, Functor s) => Monad (Trampoline m s) where instance (Monad m, Functor s) => MonadFail (Trampoline m s) where fail = error -data Yield x y = Yield! x y +data Yield x y = Yield !x y instance Functor (Yield x) where fmap f (Yield x y) = trace "fmap yield" $ Yield x (f y) -data Await x y = Await! (x -> y) +data Await x y = Await !(x -> y) instance Functor (Await x) where fmap f (Await g) = trace "fmap await" $ Await (f . g) diff --git a/testsuite/tests/typecheck/should_fail/T11313.hs b/testsuite/tests/typecheck/should_fail/T11313.hs index 68aa5b0f6c..27a4397bf0 100644 --- a/testsuite/tests/typecheck/should_fail/T11313.hs +++ b/testsuite/tests/typecheck/should_fail/T11313.hs @@ -2,6 +2,6 @@ module T11313 where -x = fmap @ (*) +x = fmap @(*) -- test error message output, which was quite silly before diff --git a/testsuite/tests/typecheck/should_fail/T11313.stderr b/testsuite/tests/typecheck/should_fail/T11313.stderr index 8697d3b6c7..ba71dd4e88 100644 --- a/testsuite/tests/typecheck/should_fail/T11313.stderr +++ b/testsuite/tests/typecheck/should_fail/T11313.stderr @@ -1,5 +1,5 @@ -T11313.hs:5:13: error: +T11313.hs:5:12: error: • Expected kind ‘* -> *’, but ‘*’ has kind ‘*’ • In the type ‘(*)’ In the expression: fmap @(*) diff --git a/testsuite/tests/typecheck/should_fail/T12529.hs b/testsuite/tests/typecheck/should_fail/T12529.hs index ac4e31db68..a2679286e5 100644 --- a/testsuite/tests/typecheck/should_fail/T12529.hs +++ b/testsuite/tests/typecheck/should_fail/T12529.hs @@ -2,4 +2,4 @@ module T12529 where -f = p @ Int +f = p @Int diff --git a/testsuite/tests/typecheck/should_fail/tcfail112.hs b/testsuite/tests/typecheck/should_fail/tcfail112.hs index 5252f83b14..71f3dd4305 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail112.hs +++ b/testsuite/tests/typecheck/should_fail/tcfail112.hs @@ -4,7 +4,7 @@ module ShouldFail where -data S = S { x::Int, y:: ! Int } +data S = S { x::Int, y:: !Int } data T = T Int !Int data U = U Int Int |