3
3
{-# LANGUAGE DataKinds #-}
4
4
{-# LANGUAGE DuplicateRecordFields #-}
5
5
{-# LANGUAGE GADTs #-}
6
- {-# LANGUAGE ImplicitParams #-}
7
6
{-# LANGUAGE LambdaCase #-}
8
- {-# LANGUAGE MultiWayIf #-}
9
7
{-# LANGUAGE NamedFieldPuns #-}
10
8
{-# LANGUAGE OverloadedStrings #-}
11
9
{-# LANGUAGE PatternSynonyms #-}
@@ -2388,11 +2386,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2388
2386
, " "
2389
2387
, " f = 1"
2390
2388
])
2391
- #if MIN_VERSION_ghc(9,4,0)
2392
- [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the type variable" ) ]
2393
- #else
2394
- [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the following constraint" ) ]
2395
- #endif
2389
+ (if ghcVersion >= GHC94
2390
+ then [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the type variable" ) ]
2391
+ else [ (DiagnosticSeverity_Warning , (3 , 4 ), " Defaulting the following constraint" ) ])
2396
2392
" Add type annotation ‘Integer’ to ‘1’"
2397
2393
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2398
2394
, " module A (f) where"
@@ -2409,11 +2405,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2409
2405
, " let x = 3"
2410
2406
, " in x"
2411
2407
])
2412
- #if MIN_VERSION_ghc(9,4,0)
2413
- [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the type variable" ) ]
2414
- #else
2415
- [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the following constraint" ) ]
2416
- #endif
2408
+ (if ghcVersion >= GHC94
2409
+ then [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the type variable" ) ]
2410
+ else [ (DiagnosticSeverity_Warning , (4 , 12 ), " Defaulting the following constraint" ) ])
2417
2411
" Add type annotation ‘Integer’ to ‘3’"
2418
2412
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2419
2413
, " module A where"
@@ -2431,11 +2425,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2431
2425
, " let x = let y = 5 in y"
2432
2426
, " in x"
2433
2427
])
2434
- #if MIN_VERSION_ghc(9,4,0)
2435
- [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the type variable" ) ]
2436
- #else
2437
- [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the following constraint" ) ]
2438
- #endif
2428
+ (if ghcVersion >= GHC94
2429
+ then [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the type variable" ) ]
2430
+ else [ (DiagnosticSeverity_Warning , (4 , 20 ), " Defaulting the following constraint" ) ])
2439
2431
" Add type annotation ‘Integer’ to ‘5’"
2440
2432
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2441
2433
, " module A where"
@@ -2454,15 +2446,15 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2454
2446
, " "
2455
2447
, " f = seq \" debug\" traceShow \" debug\" "
2456
2448
])
2457
- #if MIN_VERSION_ghc(9,4,0)
2458
- [ ( DiagnosticSeverity_Warning , ( 6 , 8 ), " Defaulting the type variable " )
2459
- , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the type variable" )
2460
- ]
2461
- #else
2462
- [ ( DiagnosticSeverity_Warning , ( 6 , 8 ), " Defaulting the following constraint " )
2463
- , (DiagnosticSeverity_Warning , (6 , 16 ), " Defaulting the following constraint" )
2464
- ]
2465
- #endif
2449
+ ( if ghcVersion >= GHC94
2450
+ then
2451
+ [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the type variable" )
2452
+ , ( DiagnosticSeverity_Warning , ( 6 , 16 ), " Defaulting the type variable " )
2453
+ ]
2454
+ else
2455
+ [ (DiagnosticSeverity_Warning , (6 , 8 ), " Defaulting the following constraint" )
2456
+ , ( DiagnosticSeverity_Warning , ( 6 , 16 ), " Defaulting the following constraint " )
2457
+ ])
2466
2458
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2467
2459
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2468
2460
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2482,11 +2474,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2482
2474
, " "
2483
2475
, " f a = traceShow \" debug\" a"
2484
2476
])
2485
- #if MIN_VERSION_ghc(9,4,0)
2486
- [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the type variable" ) ]
2487
- #else
2488
- [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the following constraint" ) ]
2489
- #endif
2477
+ (if ghcVersion >= GHC94
2478
+ then [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the type variable" ) ]
2479
+ else [ (DiagnosticSeverity_Warning , (6 , 6 ), " Defaulting the following constraint" ) ])
2490
2480
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2491
2481
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2492
2482
, " {-# LANGUAGE OverloadedStrings #-}"
@@ -2506,11 +2496,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
2506
2496
, " "
2507
2497
, " f = seq (\" debug\" :: [Char]) (seq (\" debug\" :: [Char]) (traceShow \" debug\" ))"
2508
2498
])
2509
- #if MIN_VERSION_ghc(9,4,0)
2510
- [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the type variable" ) ]
2511
- #else
2512
- [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the following constraint" ) ]
2513
- #endif
2499
+ (if ghcVersion >= GHC94
2500
+ then [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the type variable" ) ]
2501
+ else [ (DiagnosticSeverity_Warning , (6 , 54 ), " Defaulting the following constraint" ) ])
2514
2502
(" Add type annotation ‘" <> listOfChar <> " ’ to ‘\" debug\" ’" )
2515
2503
(T. unlines [ " {-# OPTIONS_GHC -Wtype-defaults #-}"
2516
2504
, " {-# LANGUAGE OverloadedStrings #-}"
0 commit comments