@@ -2530,7 +2530,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
25302530 , " "
25312531 , " f = 1"
25322532 ])
2533+ #if MIN_VERSION_ghc(9,4,0)
2534+ [ (DsWarning , (3 , 4 ), " Defaulting the type variable" ) ]
2535+ #else
25332536 [ (DsWarning , (3 , 4 ), " Defaulting the following constraint" ) ]
2537+ #endif
25342538 " Add type annotation ‘Integer’ to ‘1’"
25352539 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
25362540 , " module A (f) where"
@@ -2547,7 +2551,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
25472551 , " let x = 3"
25482552 , " in x"
25492553 ])
2554+ #if MIN_VERSION_ghc(9,4,0)
2555+ [ (DsWarning , (4 , 12 ), " Defaulting the type variable" ) ]
2556+ #else
25502557 [ (DsWarning , (4 , 12 ), " Defaulting the following constraint" ) ]
2558+ #endif
25512559 " Add type annotation ‘Integer’ to ‘3’"
25522560 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
25532561 , " module A where"
@@ -2565,7 +2573,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
25652573 , " let x = let y = 5 in y"
25662574 , " in x"
25672575 ])
2576+ #if MIN_VERSION_ghc(9,4,0)
2577+ [ (DsWarning , (4 , 20 ), " Defaulting the type variable" ) ]
2578+ #else
25682579 [ (DsWarning , (4 , 20 ), " Defaulting the following constraint" ) ]
2580+ #endif
25692581 " Add type annotation ‘Integer’ to ‘5’"
25702582 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
25712583 , " module A where"
@@ -2584,9 +2596,15 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
25842596 , " "
25852597 , " f = seq \" debug\" traceShow \" debug\" "
25862598 ])
2599+ #if MIN_VERSION_ghc(9,4,0)
2600+ [ (DsWarning , (6 , 8 ), " Defaulting the type variable" )
2601+ , (DsWarning , (6 , 16 ), " Defaulting the type variable" )
2602+ ]
2603+ #else
25872604 [ (DsWarning , (6 , 8 ), " Defaulting the following constraint" )
25882605 , (DsWarning , (6 , 16 ), " Defaulting the following constraint" )
25892606 ]
2607+ #endif
25902608 (" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
25912609 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
25922610 , " {-# LANGUAGE OverloadedStrings #-}"
@@ -2596,7 +2614,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
25962614 , " "
25972615 , " f = seq (\" debug\" :: " <> listOfChar <> " ) traceShow \" debug\" "
25982616 ])
2599- , knownBrokenForGhcVersions [GHC92 ] " GHC 9.2 only has 'traceShow' in error span" $
2617+ , knownBrokenForGhcVersions [GHC92 , GHC94 ] " GHC 9.2 only has 'traceShow' in error span" $
26002618 testSession " add default type to satisfy two constraints" $
26012619 testFor
26022620 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2607,7 +2625,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
26072625 , " "
26082626 , " f a = traceShow \" debug\" a"
26092627 ])
2628+ #if MIN_VERSION_ghc(9,4,0)
2629+ [ (DsWarning , (6 , 6 ), " Defaulting the type variable" ) ]
2630+ #else
26102631 [ (DsWarning , (6 , 6 ), " Defaulting the following constraint" ) ]
2632+ #endif
26112633 (" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
26122634 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
26132635 , " {-# LANGUAGE OverloadedStrings #-}"
@@ -2617,7 +2639,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
26172639 , " "
26182640 , " f a = traceShow (\" debug\" :: " <> listOfChar <> " ) a"
26192641 ])
2620- , knownBrokenForGhcVersions [GHC92 ] " GHC 9.2 only has 'traceShow' in error span" $
2642+ , knownBrokenForGhcVersions [GHC92 , GHC94 ] " GHC 9.2 only has 'traceShow' in error span" $
26212643 testSession " add default type to satisfy two constraints with duplicate literals" $
26222644 testFor
26232645 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2628,7 +2650,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
26282650 , " "
26292651 , " f = seq (\" debug\" :: [Char]) (seq (\" debug\" :: [Char]) (traceShow \" debug\" ))"
26302652 ])
2653+ #if MIN_VERSION_ghc(9,4,0)
2654+ [ (DsWarning , (6 , 54 ), " Defaulting the type variable" ) ]
2655+ #else
26312656 [ (DsWarning , (6 , 54 ), " Defaulting the following constraint" ) ]
2657+ #endif
26322658 (" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
26332659 (T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
26342660 , " {-# LANGUAGE OverloadedStrings #-}"
@@ -3245,15 +3271,15 @@ removeRedundantConstraintsTests = let
32453271 " Remove redundant constraints `(Monoid a, Show a)` from the context of the type signature for `foo`"
32463272 (typeSignatureSpaces $ Just " Monoid a, Show a" )
32473273 (typeSignatureSpaces Nothing )
3248- , check
3274+ , check
32493275 " Remove redundant constraint `Eq a` from the context of the type signature for `foo`"
32503276 typeSignatureLined1
32513277 typeSignatureOneLine
3252- , check
3278+ , check
32533279 " Remove redundant constraints `(Eq a, Show a)` from the context of the type signature for `foo`"
32543280 typeSignatureLined2
32553281 typeSignatureOneLine
3256- , check
3282+ , check
32573283 " Remove redundant constraint `Show a` from the context of the type signature for `foo`"
32583284 typeSignatureLined3
32593285 typeSignatureLined3'
@@ -4006,4 +4032,3 @@ assertJust s = \case
40064032listOfChar :: T. Text
40074033listOfChar | ghcVersion >= GHC90 = " String"
40084034 | otherwise = " [Char]"
4009-
0 commit comments