Skip to content

Commit 18446ea

Browse files
committed
Don't write annotation in case of IncorrectDeadAnnotation.
1 parent 5eff0c4 commit 18446ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

analysis/reanalyze/examples/deadcode/expected/deadcode.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,8 +2592,6 @@ File References
25922592
Incorrect Dead Annotation
25932593
File "DeadTest.res", line 178, characters 1-23
25942594
deadIncorrect is annotated @dead but is live
2595-
<-- line 178
2596-
@dead("deadIncorrect") let deadIncorrect = 34
25972595

25982596
Warning Unused Argument
25992597
File "TestOptArg.res", line 9, characters 1-66

analysis/reanalyze/src/DeadCommon.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ let emitWarning ~decl ~message deadWarning =
401401
| _ -> false
402402
in
403403
let shouldWriteAnnotation =
404-
(not (isToplevelValueWithSideEffects decl)) && Suppress.filter decl.pos
404+
(not (isToplevelValueWithSideEffects decl))
405+
&& Suppress.filter decl.pos
406+
&& deadWarning <> IncorrectDeadAnnotation
405407
in
406408
let lineInfo =
407409
if shouldWriteAnnotation then decl |> WriteDeadAnnotations.onDeadDecl

0 commit comments

Comments
 (0)