-
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.
Also consider accessed type when checking for classwide type
When checking if types match (in an assign context), also consider accessed type when checking for classwide type.
- Loading branch information
Showing
4 changed files
with
41 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
20 changes: 20 additions & 0 deletions
20
testsuite/tests/name_resolution/matching_assign_type/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,20 @@ | ||
procedure Test is | ||
|
||
type MDI is tagged null record; | ||
type MDI_Child is access all MDI'Class; | ||
|
||
type Local_T is new MDI with null record; | ||
|
||
function Set return access Local_T'Class; | ||
|
||
function Set return access Local_T'Class is | ||
begin | ||
return null; | ||
end Set; | ||
|
||
Child : MDI_Child; | ||
|
||
begin | ||
Child := Set; | ||
pragma Test_Statement; | ||
end Test; |
17 changes: 17 additions & 0 deletions
17
testsuite/tests/name_resolution/matching_assign_type/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,17 @@ | ||
Analyzing test.adb | ||
################## | ||
|
||
Resolving xrefs for node <AssignStmt test.adb:18:5-18:18> | ||
********************************************************* | ||
|
||
Expr: <Id "Child" test.adb:18:5-18:10> | ||
references: <DefiningName "Child" test.adb:15:4-15:9> | ||
type: <ConcreteTypeDecl ["MDI_Child"] test.adb:4:4-4:43> | ||
expected type: None | ||
Expr: <Id "Set" test.adb:18:14-18:17> | ||
references: <DefiningName "Set" test.adb:10:13-10:16> | ||
type: <AnonymousTypeDecl ["None"] test.adb:10:24-10:44> | ||
expected type: <ConcreteTypeDecl ["MDI_Child"] test.adb:4:4-4:43> | ||
|
||
|
||
Done. |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/matching_assign_type/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] |