Skip to content

Commit 350ad5d

Browse files
committed
Fix the 'nested_paths' rule
1 parent 44f8b40 commit 350ad5d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lkql_checker/share/lkql/nested_paths.lkql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fun nested_paths(node) =
4949
if_stmt.f_alternatives[1] == null
5050

5151
# Has an "else" part
52-
and if_stmt.f_else_part.f_stmts[1] != null
52+
and if_stmt.f_else_part != null
5353

5454
and not has_last_breaking_stmt(node)
5555
and has_last_breaking_stmt(if if_stmt.f_then_stmts == node

testsuite/tests/checks/nested_paths/paths.adb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ begin
9393
else
9494
I := I + 1; -- NOFLAG
9595
end if;
96+
97+
if Cond then
98+
null; -- NOFLAG
99+
end if;
96100
end Paths;

0 commit comments

Comments
 (0)