-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix retrieval of corresponding GenericSubpDecl.
The previous code looked at indices 1 and 2, which kind of worked because in general index 0 is where the body itself will be. However with the attached test case it is not the case: the GenericSubpDecl will be at index 0, meaning the previous code would fail to find it.
- Loading branch information
Showing
7 changed files
with
57 additions
and
6 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
3 changes: 3 additions & 0 deletions
3
testsuite/tests/name_resolution/generic_formal_package_naming/pkg-gen.ads
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,3 @@ | ||
generic | ||
type T is private; | ||
procedure Pkg.Gen (X : T); |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/name_resolution/generic_formal_package_naming/pkg-gen__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,6 @@ | ||
procedure Pkg.Gen (X : T) is | ||
pragma Assert (T'Size = 8); | ||
pragma Test_Statement; | ||
begin | ||
null; | ||
end Pkg.Gen; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/generic_formal_package_naming/pkg.ads
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 @@ | ||
package Pkg is | ||
end Pkg; |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/name_resolution/generic_formal_package_naming/prj.gpr
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,6 @@ | ||
project Prj is | ||
package Naming is | ||
for Implementation ("Pkg.Gen") | ||
use "pkg-gen__test.adb"; | ||
end Naming; | ||
end Prj; |
36 changes: 36 additions & 0 deletions
36
testsuite/tests/name_resolution/generic_formal_package_naming/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,36 @@ | ||
Analyzing pkg-gen__test.adb | ||
########################### | ||
|
||
Resolving xrefs for node <PragmaNode pkg-gen__test.adb:2:4-2:31> | ||
**************************************************************** | ||
|
||
Expr: <Id "Assert" pkg-gen__test.adb:2:11-2:17> | ||
references: None | ||
type: None | ||
expected type: None | ||
Expr: <RelationOp pkg-gen__test.adb:2:19-2:29> | ||
type: <ConcreteTypeDecl ["Boolean"] __standard:3:3-3:33> | ||
expected type: <ConcreteTypeDecl ["Boolean"] __standard:3:3-3:33> | ||
Expr: <AttributeRef pkg-gen__test.adb:2:19-2:25> | ||
references: None | ||
type: <ConcreteTypeDecl ["Universal_Int_Type_"] __standard:116:3-116:45> | ||
expected type: <ConcreteTypeDecl ["root_integer"] __standard:120:3-120:38> | ||
Expr: <Id "T" pkg-gen__test.adb:2:19-2:20> | ||
references: <DefiningName "T" pkg-gen.ads:2:9-2:10> | ||
type: None | ||
expected type: None | ||
Expr: <Id "Size" pkg-gen__test.adb:2:21-2:25> | ||
references: None | ||
type: None | ||
expected type: None | ||
Expr: <OpEq "=" pkg-gen__test.adb:2:26-2:27> | ||
references: <SyntheticDefiningName ""="" __standard:120:24-120:37> | ||
type: None | ||
expected type: None | ||
Expr: <Int pkg-gen__test.adb:2:28-2:29> | ||
references: None | ||
type: <ConcreteTypeDecl ["Universal_Int_Type_"] __standard:116:3-116:45> | ||
expected type: <ConcreteTypeDecl ["root_integer"] __standard:120:3-120:38> | ||
|
||
|
||
Done. |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/generic_formal_package_naming/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: name-resolution | ||
input_sources: [pkg-gen__test.adb] |