-
Notifications
You must be signed in to change notification settings - Fork 42
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/949' into 'master'
nameres: fix record assoc expression matching type predicate Closes #949 See merge request eng/libadalang/libadalang!1287
- Loading branch information
Showing
4 changed files
with
58 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
testsuite/tests/name_resolution/anonymous_type_match/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,23 @@ | ||
procedure Test is | ||
type Obj is tagged null record; | ||
|
||
type T is record | ||
Class : access Obj'Class; | ||
end record; | ||
|
||
type Obj2 is new Obj with record | ||
I : Integer; | ||
end record; | ||
|
||
procedure P (Prm : access Obj2); | ||
|
||
procedure P (Prm : access Obj2) is | ||
E : T := T'(Class => Prm); | ||
pragma Test_Statement; | ||
begin | ||
null; | ||
end P; | ||
|
||
begin | ||
null; | ||
end Test; |
32 changes: 32 additions & 0 deletions
32
testsuite/tests/name_resolution/anonymous_type_match/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,32 @@ | ||
Analyzing test.adb | ||
################## | ||
|
||
Resolving xrefs for node <ObjectDecl ["E"] test.adb:15:8-15:34> | ||
*************************************************************** | ||
|
||
Expr: <Id "T" test.adb:15:12-15:13> | ||
references: <DefiningName "T" test.adb:4:9-4:10> | ||
type: None | ||
expected type: None | ||
Expr: <QualExpr test.adb:15:17-15:33> | ||
references: <DefiningName "T" test.adb:4:9-4:10> | ||
type: <ConcreteTypeDecl ["T"] test.adb:4:4-6:15> | ||
expected type: <ConcreteTypeDecl ["T"] test.adb:4:4-6:15> | ||
Expr: <Id "T" test.adb:15:17-15:18> | ||
references: <DefiningName "T" test.adb:4:9-4:10> | ||
type: None | ||
expected type: None | ||
Expr: <Aggregate test.adb:15:19-15:33> | ||
type: <ConcreteTypeDecl ["T"] test.adb:4:4-6:15> | ||
expected type: <ConcreteTypeDecl ["T"] test.adb:4:4-6:15> | ||
Expr: <Id "Class" test.adb:15:20-15:25> | ||
references: <DefiningName "Class" test.adb:5:7-5:12> | ||
type: None | ||
expected type: None | ||
Expr: <Id "Prm" test.adb:15:29-15:32> | ||
references: <DefiningName "Prm" test.adb:14:17-14:20> | ||
type: <AnonymousTypeDecl ["None"] test.adb:14:23-14:34> | ||
expected type: <AnonymousTypeDecl ["None"] test.adb:5:15-5:31> | ||
|
||
|
||
Done. |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/anonymous_type_match/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] |