@@ -3660,7 +3660,7 @@ thReloadingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3660
3660
bdoc <- createDoc bPath " haskell" bSource
3661
3661
cdoc <- createDoc cPath " haskell" cSource
3662
3662
3663
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3663
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3664
3664
3665
3665
-- Change th from () to Bool
3666
3666
let aSource' = T. unlines $ init (T. lines aSource) ++ [" th_a = [d| a = False|]" ]
@@ -3672,7 +3672,7 @@ thReloadingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3672
3672
expectDiagnostics
3673
3673
[(" THC.hs" , [(DsError , (4 , 4 ), " Couldn't match expected type '()' with actual type 'Bool'" )])
3674
3674
,(" THC.hs" , [(DsWarning , (6 ,0 ), " Top-level binding" )])
3675
- ,(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding " )])
3675
+ ,(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level bindin " )])
3676
3676
]
3677
3677
3678
3678
closeDoc adoc
@@ -3695,7 +3695,7 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3695
3695
adoc <- createDoc aPath " haskell" aSource
3696
3696
bdoc <- createDoc bPath " haskell" bSource
3697
3697
3698
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3698
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3699
3699
3700
3700
let aSource' = T. unlines $ init (init (T. lines aSource)) ++ [" th :: DecsQ" , " th = [d| a = False|]" ]
3701
3701
changeDoc adoc [TextDocumentContentChangeEvent Nothing Nothing aSource']
@@ -3704,7 +3704,7 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3704
3704
let bSource' = T. unlines $ init (T. lines bSource) ++ [" $th" ]
3705
3705
changeDoc bdoc [TextDocumentContentChangeEvent Nothing Nothing bSource']
3706
3706
3707
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3707
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3708
3708
3709
3709
closeDoc adoc
3710
3710
closeDoc bdoc
@@ -4698,7 +4698,7 @@ ifaceTHTest = testCase "iface-th-test" $ runWithExtraFiles "TH" $ \dir -> do
4698
4698
changeDoc cdoc [TextDocumentContentChangeEvent Nothing Nothing cSource]
4699
4699
expectDiagnostics
4700
4700
[(" THC.hs" , [(DsError , (4 , 4 ), " Couldn't match expected type '()' with actual type 'Bool'" )])
4701
- ,(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
4701
+ ,(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
4702
4702
closeDoc cdoc
4703
4703
4704
4704
ifaceErrorTest :: TestTree
@@ -5515,3 +5515,11 @@ listOfChar = "String"
5515
5515
#else
5516
5516
listOfChar = " [Char]"
5517
5517
#endif
5518
+
5519
+ -- | Ghc 9 doesn't include the $-sign in TH warnings like earlier versions did
5520
+ thDollarIdx :: Int
5521
+ #if MIN_GHC_API_VERSION(9,0,1)
5522
+ thDollarIdx = 1
5523
+ #else
5524
+ thDollarIdx = 0
5525
+ #endif
0 commit comments