git.iko.soy/typeable/haskell-stack-trace-plugin
on master help sign in
haskell-stack-trace-plugin.cabal+2−2
since splitsnapshots
unifiedsplit
@@ -32,13 +32,13 @@ flag dev
32 default: False
32 default: False
33
33
34common common-opts
34common common-opts
35− build-depends: base >=4.12 && <4.16
35+ build-depends: base >=4.12 && <4.18
36 default-language: Haskell2010
36 default-language: Haskell2010
37
37
38library
38library
39 import: common-opts
39 import: common-opts
40 hs-source-dirs: src
40 hs-source-dirs: src
41− build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10 || ^>=9.0
41+ build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10 || ^>=9.0 || ^>=9.2 || ^>=9.4
42 exposed-modules: StackTrace.Plugin
42 exposed-modules: StackTrace.Plugin
43
43
44 if flag(dev)
44 if flag(dev)
src/StackTrace/Plugin.hs+9−3
@@ -5,6 +5,7 @@ module StackTrace.Plugin (plugin) where
5
5
6import Control.Arrow (first)
6import Control.Arrow (first)
7import Data.Monoid (Any(Any, getAny))
7import Data.Monoid (Any(Any, getAny))
8+import GHC.Types.SrcLoc
8#if __GLASGOW_HASKELL__ >= 900
9#if __GLASGOW_HASKELL__ >= 900
9import GHC.Plugins
10import GHC.Plugins
10#else
11#else
@@ -49,9 +50,14 @@ importDeclQualified = QualifiedPre
49
50
50ghcStackImport :: Located (ImportDecl (GhcPass p))
51ghcStackImport :: Located (ImportDecl (GhcPass p))
51ghcStackImport =
52ghcStackImport =
52− noLoc $
53+ L srcSpan $
53 (simpleImportDecl $ mkModuleName "GHC.Stack")
54 (simpleImportDecl $ mkModuleName "GHC.Stack")
54− {ideclQualified = importDeclQualified, ideclAs = Just $ noLoc ghcStackModuleName}
55+ { ideclQualified = importDeclQualified, ideclAs = Just $ noLoc ghcStackModuleName }
56+ where
57+ -- This is for GHC-9 related problems. @noLoc@ causes GHC to throw warnings
58+ -- about unused imports. Even if the import is used
59+ -- See: https://github.com/waddlaw/haskell-stack-trace-plugin/issues/16
60+ srcSpan = RealSrcSpan (realSrcLocSpan $ mkRealSrcLoc "haskell-stack-trace-plugin:very-unique-file-name-to-avoid-collision" 1 1) Nothing
55
61
56#if __GLASGOW_HASKELL__ >= 900
62#if __GLASGOW_HASKELL__ >= 900
57updateHsModule :: HsModule -> HsModule
63updateHsModule :: HsModule -> HsModule
@@ -170,7 +176,7 @@ updateHsType ty@HsAppTy {} =
170 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
176 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
171updateHsType ty@HsFunTy {} =
177updateHsType ty@HsFunTy {} =
172 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
178 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
173−updateHsType ty@HsListTy {} =
179+updateHsType ty@HsListTy {} =
174 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
180 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
175updateHsType ty@HsTupleTy {} =
181updateHsType ty@HsTupleTy {} =
176 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)
182 flagASTModified $ HsQualTy xQualTy (noLoc $ appendHSC []) (noLoc ty)