Skip to content

Commit e3dfd4e

Browse files
committed
Adapt KPs after LaL's p_is_static_subtype changes
For libadalang#1509
1 parent 63a679d commit e3dfd4e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lkql_checker/share/lkql/kp/KP-19279.lkql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fun contains_dynamic_bounds(agg) =
2323
not tn.p_is_static_subtype()
2424
| n@Name =>
2525
n.p_referenced_decl()?.p_type_expression() is SubtypeIndication(
26-
p_is_static_subtype(): false
26+
p_is_statically_constrained(): false
2727
)
2828
)
2929
| Name(p_name_designated_type(): not null) =>

lkql_checker/share/lkql/kp/KP-19501.lkql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fun is_dynamic_subtyped_entity(name) =
1515
| DefiningName => name.p_basic_decl()
1616
| Name => name.p_referenced_decl();
1717
decl is (ComponentDef | DiscriminantSpec | ObjectDecl | ParamSpec)
18-
when decl.f_type_expr is (SubtypeIndication | Name)(
19-
p_is_static_subtype(): false
18+
when decl.f_type_expr is (SubtypeIndication)(
19+
p_is_statically_constrained(): false
2020
)
2121
}
2222

@@ -27,7 +27,7 @@ fun array_index_has_kp(expr, array_decl, child_n) =
2727
|" ``child_n``.
2828
match expr.f_suffix[child_n]?.f_r_expr
2929
| e when is_static_int_attr(e) =>
30-
if array_decl.f_type_expr.p_is_static_subtype()
30+
if array_decl.f_type_expr.p_is_statically_constrained()
3131
then array_index_has_kp(expr, array_decl, child_n + 1)
3232
| null => false
3333
| * => array_index_has_kp(expr, array_decl, child_n + 1)
@@ -61,6 +61,6 @@ fun kp_19501(node) =
6161
is_dynamic_subtyped_entity(node.f_dest)
6262
| QualExpr(f_suffix: ParenExpr(f_expr: operand)) =>
6363
is_static_int_attr(operand) and
64-
node.f_prefix is (SubtypeIndication | Name)(
65-
p_is_static_subtype(): false
64+
node.f_prefix is (Name)(
65+
p_name_designated_type(): BaseTypeDecl(p_is_statically_constrained(): false)
6666
)

0 commit comments

Comments
 (0)