Skip to content

Commit 1b76381

Browse files
committed
Merge branch 'topic/fix_kp_u310_012' into 'master'
Fix the KP-U310-012 detector Closes #408 See merge request eng/libadalang/langkit-query-language!349
2 parents 9069e57 + 0b55301 commit 1b76381

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lkql_checker/share/lkql/kp/KP-U310-012.lkql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fun kp_u310_012(node) =
1111
node is SubpSpec(f_subp_kind: SubpKindFunction)
1212
when node.p_return_type() is TypeDecl(p_full_view(): ret@TypeDecl)
1313
when is_unconstrained(ret)
14-
and (node.parent.p_has_aspect("Post") or
14+
and (node.parent is BasicDecl(p_has_aspect("Post"): true) or
1515
ret.p_has_aspect("Type_Invariant"))

testsuite/tests/checks/KP-U310-012/p.ads

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ package P is
1414
function Create return T_Array with Post => True; -- FLAG
1515
function No_Flag return T_Array; -- NOFLAG
1616

17+
type F_Access is access function (B : Boolean) return String;
18+
1719
private
1820

1921
type T_Array2 is array (Positive range <>) of T

0 commit comments

Comments
 (0)