Commit 529cbf1a authored by Profpatsch's avatar Profpatsch
Browse files

haskell-language-server: check `supportedGhcVersions` in assert

This produces a better error message than just returning the error of
the `haskell.packages."ghc${version}"` interpolation.
parent 2099ebdf
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -14,6 +14,16 @@
# See https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#static-binaries for more information.
, dynamic ? true
}:

assert
  lib.asserts.assertEachOneOf
    "supportedGhcVersions"
    supportedGhcVersions
    (lib.pipe haskell.packages [
      lib.attrNames
      (lib.filter (lib.hasPrefix "ghc"))
      (map (lib.removePrefix "ghc"))
    ]);
#
# The recommended way to override this package is
#