Skip to content

Commit f72f2d9

Browse files
committed
Fix 'type wilcard actions' tests
1 parent 0e61fa3 commit f72f2d9

File tree

1 file changed

+13
-7
lines changed
  • plugins/hls-refactor-plugin/test

1 file changed

+13
-7
lines changed

plugins/hls-refactor-plugin/test/Main.hs

+13-7
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ typeWildCardActionTests = testGroup "type wildcard actions"
642642
[ "func :: _"
643643
, "func x = x"
644644
]
645-
[ "func :: p -> p"
645+
[ if ghcVersion >= GHC910 then "func :: t -> t" else "func :: p -> p"
646646
, "func x = x"
647647
]
648648
, testUseTypeSignature "local signature"
@@ -662,9 +662,12 @@ typeWildCardActionTests = testGroup "type wildcard actions"
662662
[ "func :: _"
663663
, "func x y = x + y"
664664
]
665-
[ if ghcVersion >= GHC98
666-
then "func :: a -> a -> a" -- since 9.8 GHC no longer does type defaulting (see https://gitlab.haskell.org/ghc/ghc/-/issues/24522)
667-
else "func :: Integer -> Integer -> Integer"
665+
[ if ghcVersion >= GHC910 then
666+
"func :: t -> t -> t"
667+
else if ghcVersion >= GHC98 then
668+
"func :: a -> a -> a" -- since 9.8 GHC no longer does type defaulting (see https://gitlab.haskell.org/ghc/ghc/-/issues/24522)
669+
else
670+
"func :: Integer -> Integer -> Integer"
668671
, "func x y = x + y"
669672
]
670673
, testUseTypeSignature "type in parentheses"
@@ -692,9 +695,12 @@ typeWildCardActionTests = testGroup "type wildcard actions"
692695
[ "func::_"
693696
, "func x y = x + y"
694697
]
695-
[ if ghcVersion >= GHC98
696-
then "func::a -> a -> a" -- since 9.8 GHC no longer does type defaulting (see https://gitlab.haskell.org/ghc/ghc/-/issues/24522)
697-
else "func::Integer -> Integer -> Integer"
698+
[ if ghcVersion >= GHC910 then
699+
"func::t -> t -> t"
700+
else if ghcVersion >= GHC98 then
701+
"func::a -> a -> a" -- since 9.8 GHC no longer does type defaulting (see https://gitlab.haskell.org/ghc/ghc/-/issues/24522)
702+
else
703+
"func::Integer -> Integer -> Integer"
698704
, "func x y = x + y"
699705
]
700706
, testGroup "add parens if hole is part of bigger type"

0 commit comments

Comments
 (0)