-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/resolve_overloaded_actual' into 'master'
Fix resolution of generic subprogram actuals. Closes #1161 See merge request eng/libadalang/libadalang!1482
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
testsuite/tests/name_resolution/overloaded_generic_subp_actual/test.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
procedure Test is | ||
generic | ||
with procedure Foo (X : Integer); | ||
procedure Gen; | ||
|
||
procedure Gen is | ||
begin | ||
Foo (42); | ||
end Gen; | ||
|
||
-- Define three potential candidates for the actual in the instantiation | ||
-- below. | ||
procedure Bar (X : Boolean) is null; | ||
procedure Bar (X : Integer) is null; | ||
procedure Bar (X : Float) is null; | ||
|
||
procedure My_Gen is new Gen (Foo => Bar); | ||
--% gen = node.p_designated_generic_decl.p_body_part() | ||
--% gen.find(lal.CallExpr).f_name.p_referenced_decl() | ||
begin | ||
null; | ||
end Test; |
8 changes: 8 additions & 0 deletions
8
testsuite/tests/name_resolution/overloaded_generic_subp_actual/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Working on node <GenericSubpInstantiation ["My_Gen"] test.adb:17:4-17:45> | ||
========================================================================= | ||
|
||
Set 'gen' to 'node.p_designated_generic_decl.p_body_part()' | ||
Result: <| SubpBody ["Gen"] test.adb:6:4-9:12 [test.adb:17:4] |> | ||
|
||
Eval 'gen.find(lal.CallExpr).f_name.p_referenced_decl()' | ||
Result: <NullSubpDecl ["Bar"] test.adb:14:4-14:40> |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/overloaded_generic_subp_actual/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
driver: inline-playground | ||
input_sources: [test.adb] |