Skip to content

Commit

Permalink
Merge branch 'topic/regr/07082026' into 'master'
Browse files Browse the repository at this point in the history
Correct regression caused by new LAL generic renaming nodes

Closes #317

See merge request eng/libadalang/langkit-query-language!279
  • Loading branch information
HugoGGuerrier committed Aug 12, 2024
2 parents 3ba0f76 + dfa41b3 commit 5f94f13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ fun check_generic(n, node) =
fun positional_actuals_for_defaulted_generic_parameters(node) =
node is ParamAssoc(f_designator: null, parent: l@AssocList)
when match l.parent
| p@GenericSubpInstantiation =>
check_generic(p.f_generic_subp_name, node)
| p@GenericPackageInstantiation =>
check_generic(p.f_generic_pkg_name, node)
| * => false
| p@GenericSubpInstantiation =>
check_generic(
stdlib.ultimate_generic_alias(p.f_generic_subp_name),
node
)
| p@GenericPackageInstantiation =>
check_generic(
stdlib.ultimate_generic_alias(p.f_generic_pkg_name),
node
)
| * => false
7 changes: 7 additions & 0 deletions lkql_checker/share/lkql/stdlib.lkql
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ fun ultimate_subprogram_alias(name) =
.p_referenced_decl())
else name

@memoized
fun ultimate_generic_alias(name) =
|" Return the ultimately designated ``GenericDecl``, going through renamings
match name.p_referenced_decl()
| r@GenericRenamingDecl => ultimate_generic_alias(r.f_renames.f_renamed_object)
| * => name

@memoized
fun has_local_scope(n) =
|" Return ``true`` if ``n`` is enclosed in a local scope
Expand Down

0 comments on commit 5f94f13

Please sign in to comment.