forked from AdaCore/libadalang
-
Notifications
You must be signed in to change notification settings - Fork 0
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/constrain_prefix_subp_body' into 'master'
Share implementation of constrain prefix amongst all subps Closes AdaCore#953 See merge request eng/libadalang/libadalang!1276
- Loading branch information
Showing
18 changed files
with
130 additions
and
53 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
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
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
21 changes: 21 additions & 0 deletions
21
testsuite/tests/name_resolution/constrain_prefix_subp_body/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,21 @@ | ||
procedure Test is | ||
package Pkg1 is | ||
type T is tagged null record; | ||
|
||
function Foo (X : T) return Integer is (1); | ||
end Pkg1; | ||
|
||
package Pkg2 is | ||
type T is tagged null record; | ||
|
||
function Foo (X : T) return Integer is (2); | ||
end Pkg2; | ||
|
||
function Bar (X : Integer) return Pkg1.T is (null record); | ||
function Bar (Y : Boolean) return Pkg2.T is (null record); | ||
|
||
X : Integer; | ||
begin | ||
X := Bar (1).Foo; | ||
pragma Test_Statement; | ||
end Test; |
33 changes: 33 additions & 0 deletions
33
testsuite/tests/name_resolution/constrain_prefix_subp_body/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,33 @@ | ||
Analyzing test.adb | ||
################## | ||
|
||
Resolving xrefs for node <AssignStmt test.adb:19:4-19:21> | ||
********************************************************* | ||
|
||
Expr: <Id "X" test.adb:19:4-19:5> | ||
references: <DefiningName "X" test.adb:17:4-17:5> | ||
type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
expected type: None | ||
Expr: <DottedName test.adb:19:9-19:20> | ||
references: <DefiningName "Foo" test.adb:5:16-5:19> | ||
type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
expected type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
Expr: <CallExpr test.adb:19:9-19:16> | ||
references: <DefiningName "Bar" test.adb:14:13-14:16> | ||
type: <ConcreteTypeDecl ["T"] test.adb:3:7-3:36> | ||
expected type: <ConcreteTypeDecl ["T"] test.adb:3:7-3:36> | ||
Expr: <Id "Bar" test.adb:19:9-19:12> | ||
references: <DefiningName "Bar" test.adb:14:13-14:16> | ||
type: <ConcreteTypeDecl ["T"] test.adb:3:7-3:36> | ||
expected type: None | ||
Expr: <Int test.adb:19:14-19:15> | ||
references: None | ||
type: <ConcreteTypeDecl ["Universal_Int_Type_"] __standard:116:3-116:45> | ||
expected type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
Expr: <Id "Foo" test.adb:19:17-19:20> | ||
references: <DefiningName "Foo" test.adb:5:16-5:19> | ||
type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
expected type: <ConcreteTypeDecl ["Integer"] __standard:4:3-4:54> | ||
|
||
|
||
Done. |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/constrain_prefix_subp_body/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: [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
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
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
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
Oops, something went wrong.