File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
lkql_checker/share/lkql/kp
testsuite/tests/checks/KP-19312 Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ fun kp_19312(node) =
55 |" Flag "for" loop specs which define an iteration filter and which iterate
66 |" over a type which defines the "iterable" aspect.
77 node is ForLoopSpec
8- when node.f_iter_expr.p_expression_type()?.p_has_aspect?("iterable")
9- and node.f_iter_filter is not null
8+ when node.f_iter_filter is not null
9+ and node.f_iter_expr is e@Expr when (e.p_expression_type()?.p_has_aspect?("iterable"))
Original file line number Diff line number Diff line change 4040 Put_Line (" Elem: " & Elem'Image);
4141 end loop ;
4242
43+ for Elem in Integer range 1 .. 10 loop -- NOFLAG
44+ Put_Line (" Elem: " & Elem'Image);
45+ end loop ;
46+
4347 for Elem of I loop -- NOFLAG
4448 Put_Line (" Elem: " & Elem'Image);
4549 end loop ;
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ main.adb:35:44: rule violation: possible occurrence of KP 19312
2235 | S_1 : constant Integer_Sets.Set := [for E of I when False => E]; -- FLAG
33 | ^^^^^^^^^^^^^^^^^
44
5- main.adb:47 :8: rule violation: possible occurrence of KP 19312
6- 47 | for Elem in I when False loop -- FLAG
5+ main.adb:51 :8: rule violation: possible occurrence of KP 19312
6+ 51 | for Elem in I when False loop -- FLAG
77 | ^^^^^^^^^^^^^^^^^^^^
88
9- main.adb:51 :8: rule violation: possible occurrence of KP 19312
10- 51 | for Elem of I when False loop -- FLAG
9+ main.adb:55 :8: rule violation: possible occurrence of KP 19312
10+ 55 | for Elem of I when False loop -- FLAG
1111 | ^^^^^^^^^^^^^^^^^^^^
1212
You can’t perform that action at this time.
0 commit comments