-
-
Notifications
You must be signed in to change notification settings - Fork 401
Description
There's a regression in GHC 9.8 in how types of wildcards in type signatures are inferred.
We added a conditional in tests to adjust to this new behavior - see comment.
I reported it in ghc and it got rejected as "this is the new behavior now, we should just document it"
I don't think we can easily change back the behaviour (in GHC 9.6 we defaulted the type variable, which we no longer do in 9.8).
See ghc issues for details.
https://gitlab.haskell.org/ghc/ghc/-/issues/24522
https://gitlab.haskell.org/ghc/ghc/-/issues/24425
This change in behavior breaks 2 tests:
haskell-language-server/plugins/hls-refactor-plugin/test/Main.hs
Lines 665 to 673 in 9076f90
, testUseTypeSignature "multi-line message 1" | |
[ "func :: _" | |
, "func x y = x + y" | |
] | |
[ if ghcVersion >= GHC98 | |
then "func :: a -> a -> a" -- 9.8 has a different suggestion | |
else "func :: Integer -> Integer -> Integer" | |
, "func x y = x + y" | |
] |
haskell-language-server/plugins/hls-refactor-plugin/test/Main.hs
Lines 695 to 703 in 9076f90
, testUseTypeSignature "no spaces around '::'" | |
[ "func::_" | |
, "func x y = x + y" | |
] | |
[ if ghcVersion >= GHC98 | |
then "func::a -> a -> a" -- 9.8 has a different suggestion | |
else "func::Integer -> Integer -> Integer" | |
, "func x y = x + y" | |
] |
So I think we should just update the test not to rely on polymorphic type and type defaulting
e.g.
func :: _
func x y = x && y