@@ -432,23 +432,25 @@ suggestAddTypeAnnotationToSatisfyContraints sourceOpt Diagnostic{_range=_range,.
432
432
-- In the expression: seq "test" seq "test" (traceShow "test")
433
433
-- In an equation for ‘f’:
434
434
-- f = seq "test" seq "test" (traceShow "test")
435
- | Just [ty, lit] <- matchRegexUnifySpaces _message (pat False False True )
436
- <|> matchRegexUnifySpaces _message (pat False False False )
435
+ | Just [ty, lit] <- matchRegexUnifySpaces _message (pat False False True False )
436
+ <|> matchRegexUnifySpaces _message (pat False False False True )
437
+ <|> matchRegexUnifySpaces _message (pat False False False False )
437
438
= codeEdit ty lit (makeAnnotatedLit ty lit)
438
439
| Just source <- sourceOpt
439
- , Just [ty, lit] <- matchRegexUnifySpaces _message (pat True True False )
440
+ , Just [ty, lit] <- matchRegexUnifySpaces _message (pat True True False False )
440
441
= let lit' = makeAnnotatedLit ty lit;
441
442
tir = textInRange _range source
442
443
in codeEdit ty lit (T. replace lit lit' tir)
443
444
| otherwise = []
444
445
where
445
446
makeAnnotatedLit ty lit = " (" <> lit <> " :: " <> ty <> " )"
446
- pat multiple at inThe = T. concat [ " .*Defaulting the following constraint"
447
+ pat multiple at inArg inExpr = T. concat [ " .*Defaulting the following constraint"
447
448
, if multiple then " s" else " "
448
449
, " to type ‘([^ ]+)’ "
449
450
, " .*arising from the literal ‘(.+)’"
450
- , if inThe then " .+In the.+argument" else " "
451
+ , if inArg then " .+In the.+argument" else " "
451
452
, if at then " .+at" else " "
453
+ , if inExpr then " .+In the expression" else " "
452
454
, " .+In the expression"
453
455
]
454
456
codeEdit ty lit replacement =
0 commit comments