@@ -3610,7 +3610,7 @@ thReloadingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3610
3610
bdoc <- createDoc bPath " haskell" bSource
3611
3611
cdoc <- createDoc cPath " haskell" cSource
3612
3612
3613
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3613
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3614
3614
3615
3615
-- Change th from () to Bool
3616
3616
let aSource' = T. unlines $ init (T. lines aSource) ++ [" th_a = [d| a = False|]" ]
@@ -3622,7 +3622,7 @@ thReloadingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3622
3622
expectDiagnostics
3623
3623
[(" THC.hs" , [(DsError , (4 , 4 ), " Couldn't match expected type '()' with actual type 'Bool'" )])
3624
3624
,(" THC.hs" , [(DsWarning , (6 ,0 ), " Top-level binding" )])
3625
- ,(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding " )])
3625
+ ,(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level bindin " )])
3626
3626
]
3627
3627
3628
3628
closeDoc adoc
@@ -3645,7 +3645,7 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3645
3645
adoc <- createDoc aPath " haskell" aSource
3646
3646
bdoc <- createDoc bPath " haskell" bSource
3647
3647
3648
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3648
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3649
3649
3650
3650
let aSource' = T. unlines $ init (init (T. lines aSource)) ++ [" th :: DecsQ" , " th = [d| a = False|]" ]
3651
3651
changeDoc adoc [TextDocumentContentChangeEvent Nothing Nothing aSource']
@@ -3654,7 +3654,7 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
3654
3654
let bSource' = T. unlines $ init (T. lines bSource) ++ [" $th" ]
3655
3655
changeDoc bdoc [TextDocumentContentChangeEvent Nothing Nothing bSource']
3656
3656
3657
- expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
3657
+ expectDiagnostics [(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
3658
3658
3659
3659
closeDoc adoc
3660
3660
closeDoc bdoc
@@ -4648,7 +4648,7 @@ ifaceTHTest = testCase "iface-th-test" $ runWithExtraFiles "TH" $ \dir -> do
4648
4648
changeDoc cdoc [TextDocumentContentChangeEvent Nothing Nothing cSource]
4649
4649
expectDiagnostics
4650
4650
[(" THC.hs" , [(DsError , (4 , 4 ), " Couldn't match expected type '()' with actual type 'Bool'" )])
4651
- ,(" THB.hs" , [(DsWarning , (4 ,0 ), " Top-level binding" )])]
4651
+ ,(" THB.hs" , [(DsWarning , (4 ,thDollarIdx ), " Top-level binding" )])]
4652
4652
closeDoc cdoc
4653
4653
4654
4654
ifaceErrorTest :: TestTree
@@ -5429,3 +5429,11 @@ listOfChar = "String"
5429
5429
#else
5430
5430
listOfChar = " [Char]"
5431
5431
#endif
5432
+
5433
+ -- | Ghc 9 doesn't include the $-sign in TH warnings like earlier versions did
5434
+ thDollarIdx :: Int
5435
+ #if MIN_GHC_API_VERSION(9,0,1)
5436
+ thDollarIdx = 1
5437
+ #else
5438
+ thDollarIdx = 0
5439
+ #endif
0 commit comments