@@ -2530,7 +2530,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2530
2530
, " "
2531
2531
, " f = 1"
2532
2532
])
2533
+ #if MIN_VERSION_ghc(9,4,0)
2534
+ [ (DsWarning , (3 , 4 ), " Defaulting the type variable" ) ]
2535
+ #else
2533
2536
[ (DsWarning , (3 , 4 ), " Defaulting the following constraint" ) ]
2537
+ #endif
2534
2538
" Add type annotation ‘Integer’ to ‘1’"
2535
2539
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2536
2540
, " module A (f) where"
@@ -2547,7 +2551,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2547
2551
, " let x = 3"
2548
2552
, " in x"
2549
2553
])
2554
+ #if MIN_VERSION_ghc(9,4,0)
2555
+ [ (DsWarning , (4 , 12 ), " Defaulting the type variable" ) ]
2556
+ #else
2550
2557
[ (DsWarning , (4 , 12 ), " Defaulting the following constraint" ) ]
2558
+ #endif
2551
2559
" Add type annotation ‘Integer’ to ‘3’"
2552
2560
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2553
2561
, " module A where"
@@ -2565,7 +2573,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2565
2573
, " let x = let y = 5 in y"
2566
2574
, " in x"
2567
2575
])
2576
+ #if MIN_VERSION_ghc(9,4,0)
2577
+ [ (DsWarning , (4 , 20 ), " Defaulting the type variable" ) ]
2578
+ #else
2568
2579
[ (DsWarning , (4 , 20 ), " Defaulting the following constraint" ) ]
2580
+ #endif
2569
2581
" Add type annotation ‘Integer’ to ‘5’"
2570
2582
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2571
2583
, " module A where"
@@ -2584,9 +2596,15 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2584
2596
, " "
2585
2597
, " f = seq \" debug\" traceShow \" debug\" "
2586
2598
])
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
2587
2604
[ (DsWarning , (6 , 8 ), " Defaulting the following constraint" )
2588
2605
, (DsWarning , (6 , 16 ), " Defaulting the following constraint" )
2589
2606
]
2607
+ #endif
2590
2608
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2591
2609
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2592
2610
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2596,7 +2614,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2596
2614
, " "
2597
2615
, " f = seq (\" debug\" :: " <> listOfChar <> " ) traceShow \" debug\" "
2598
2616
])
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" $
2600
2618
testSession " add default type to satisfy two constraints" $
2601
2619
testFor
2602
2620
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2607,7 +2625,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2607
2625
, " "
2608
2626
, " f a = traceShow \" debug\" a"
2609
2627
])
2628
+ #if MIN_VERSION_ghc(9,4,0)
2629
+ [ (DsWarning , (6 , 6 ), " Defaulting the type variable" ) ]
2630
+ #else
2610
2631
[ (DsWarning , (6 , 6 ), " Defaulting the following constraint" ) ]
2632
+ #endif
2611
2633
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2612
2634
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2613
2635
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2617,7 +2639,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2617
2639
, " "
2618
2640
, " f a = traceShow (\" debug\" :: " <> listOfChar <> " ) a"
2619
2641
])
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" $
2621
2643
testSession " add default type to satisfy two constraints with duplicate literals" $
2622
2644
testFor
2623
2645
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2628,7 +2650,11 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2628
2650
, " "
2629
2651
, " f = seq (\" debug\" :: [Char]) (seq (\" debug\" :: [Char]) (traceShow \" debug\" ))"
2630
2652
])
2653
+ #if MIN_VERSION_ghc(9,4,0)
2654
+ [ (DsWarning , (6 , 54 ), " Defaulting the type variable" ) ]
2655
+ #else
2631
2656
[ (DsWarning , (6 , 54 ), " Defaulting the following constraint" ) ]
2657
+ #endif
2632
2658
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2633
2659
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2634
2660
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -3245,15 +3271,15 @@ removeRedundantConstraintsTests = let
3245
3271
" Remove redundant constraints `(Monoid a, Show a)` from the context of the type signature for `foo`"
3246
3272
(typeSignatureSpaces $ Just " Monoid a, Show a" )
3247
3273
(typeSignatureSpaces Nothing )
3248
- , check
3274
+ , check
3249
3275
" Remove redundant constraint `Eq a` from the context of the type signature for `foo`"
3250
3276
typeSignatureLined1
3251
3277
typeSignatureOneLine
3252
- , check
3278
+ , check
3253
3279
" Remove redundant constraints `(Eq a, Show a)` from the context of the type signature for `foo`"
3254
3280
typeSignatureLined2
3255
3281
typeSignatureOneLine
3256
- , check
3282
+ , check
3257
3283
" Remove redundant constraint `Show a` from the context of the type signature for `foo`"
3258
3284
typeSignatureLined3
3259
3285
typeSignatureLined3'
@@ -4006,4 +4032,3 @@ assertJust s = \case
4006
4032
listOfChar :: T. Text
4007
4033
listOfChar | ghcVersion >= GHC90 = " String"
4008
4034
| otherwise = " [Char]"
4009
-
0 commit comments