diff --git a/.github/workflows/ci.yml b/.github/workflows/haskell.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/haskell.yml diff --git a/package.yaml b/package.yaml index 1450ec8..197930f 100644 --- a/package.yaml +++ b/package.yaml @@ -25,7 +25,7 @@ dependencies: library: source-dirs: src dependencies: - - ghc >= 8.10.2 && <9.1 + - ghc >= 8.10.2 && <9.4 - containers >= 0.6.2.1 - term-rewriting >= 0.3.0.1 - transformers >= 0.5.6.2 diff --git a/src/TypeLevel/Rewrite/Internal/Lookup.hs b/src/TypeLevel/Rewrite/Internal/Lookup.hs index 62a1d32..e5708ea 100644 --- a/src/TypeLevel/Rewrite/Internal/Lookup.hs +++ b/src/TypeLevel/Rewrite/Internal/Lookup.hs @@ -6,8 +6,13 @@ import Data.Tuple (swap) -- GHC API import GHC (DataCon, TyCon, dataConTyCon) -#if MIN_VERSION_ghc(9,0,0) +#if MIN_VERSION_ghc(9,2,0) +import GHC.Iface.Load (cannotFindModule) +import GHC.Tc.Plugin (getTopEnv) +#elif MIN_VERSION_ghc(9,0,0) import GHC.Driver.Finder (cannotFindModule) +#endif +#if MIN_VERSION_ghc(9,0,0) import GHC (Module, ModuleName, mkModuleName) import GHC.Plugins (mkDataOcc, mkTcOcc) import GHC.Utils.Panic (panicDoc) @@ -35,9 +40,15 @@ lookupModule moduleNameStr = do Found _ module_ -> do pure module_ findResult -> do +#if MIN_VERSION_ghc(9,2,0) + hscEnv <- getTopEnv + panicDoc ("TypeLevel.Lookup.lookupModule " ++ show moduleNameStr) + $ cannotFindModule hscEnv moduleName findResult +#else dynFlags <- unsafeTcPluginTcM getDynFlags panicDoc ("TypeLevel.Lookup.lookupModule " ++ show moduleNameStr) $ cannotFindModule dynFlags moduleName findResult +#endif -- 'TcPluginM.lookupM' unfortunately fails with a very unhelpful error message -- when we look up a name which doesn't exist: diff --git a/test/should-compile/InstanceConstraints/Test.hs b/test/should-compile/InstanceConstraints/Test.hs index 57053f7..1f9e3c4 100644 --- a/test/should-compile/InstanceConstraints/Test.hs +++ b/test/should-compile/InstanceConstraints/Test.hs @@ -42,7 +42,7 @@ f5 :: forall a b x y f5 = foo @(F a x) f6 :: forall a b x y - . ( F a b ~ G x y + . ( b ~ G x y , y ~ x , x ~ y , Foo (F a b) diff --git a/typelevel-rewrite-rules.cabal b/typelevel-rewrite-rules.cabal index bd2c839..09a23b8 100644 --- a/typelevel-rewrite-rules.cabal +++ b/typelevel-rewrite-rules.cabal @@ -48,7 +48,7 @@ library build-depends: base >=4.12 && <5 , containers >=0.6.2.1 - , ghc >=8.10.2 && <9.1 + , ghc >=8.10.2 && <9.4 , ghc-prim >=0.5.3 , term-rewriting >=0.3.0.1 , transformers >=0.5.6.2