-
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/1172' into 'master'
Fix expected type for constructs expecting booleans. Closes #1172, #1154, and #1141 See merge request eng/libadalang/libadalang!1495
- Loading branch information
Showing
9 changed files
with
529 additions
and
42 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
13 changes: 13 additions & 0 deletions
13
testsuite/tests/name_resolution/if_implicit_deref/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,13 @@ | ||
with Ada.Containers.Vectors; | ||
|
||
procedure Test is | ||
package My_Vectors is new Ada.Containers.Vectors (Positive, Boolean); | ||
use My_Vectors; | ||
|
||
V : My_Vectors.Vector; | ||
begin | ||
if V (1) then | ||
null; | ||
end if; | ||
pragma Test_Statement_UID; | ||
end Test; |
21 changes: 21 additions & 0 deletions
21
testsuite/tests/name_resolution/if_implicit_deref/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,21 @@ | ||
Analyzing test.adb | ||
################## | ||
|
||
Resolving xrefs for node <IfStmt test.adb:9:4-11:11> | ||
**************************************************** | ||
|
||
Expr: <CallExpr test.adb:9:7-9:12> | ||
references: test().v | ||
type: test().my_vectors.constant_reference_type | ||
expected type: standard.boolean | ||
Expr: <Id "V" test.adb:9:7-9:8> | ||
references: test().v | ||
type: test().my_vectors.vector | ||
expected type: None | ||
Expr: <Int test.adb:9:10-9:11> | ||
references: None | ||
type: standard.universal_int_type_ | ||
expected type: standard.positive | ||
|
||
|
||
Done. |
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] |
Oops, something went wrong.