Skip to content

Commit

Permalink
Merge branch 'topic/xref_type_eq_missing_entity' into 'master'
Browse files Browse the repository at this point in the history
xref_type_equation: fail name resolution if no designated type is found

See merge request eng/libadalang/libadalang!1696
  • Loading branch information
thvnx committed Jul 15, 2024
2 parents 17d3eb2 + a2b5458 commit f836232
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ada/nodes.lkt
Original file line number Diff line number Diff line change
Expand Up @@ -12267,7 +12267,10 @@ class Name: Expr {

dn.suffix.xref_type_equation()
}
case i: BaseId => %eq(i.ref_var(), i.designated_type_impl())
case i: BaseId => i.designated_type_impl.do(
(type) => %eq(i.ref_var(), type),
default_val=self.undefined_reference_equation()
)
case ar: AttributeRef => ar.prefix.xref_type_equation() and (
if ar.attribute.sym() == s"Class" then %eq(ar.prefix.ref_var(), ar.ref_var(), conv_prop=BaseTypeDecl.classwide_type)
elif ar.attribute.sym() == s"Base" then %eq(ar.prefix.ref_var(), ar.ref_var(), conv_prop=BaseTypeDecl.scalar_base_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Resolving xrefs for node <ObjectDecl ["V"] test.adb:5:4-13:16>

Name resolution failed as expected with:

test.adb:12:7: error: expected <null>, got <null>
12 | G'Access &
| ^^^^^^^^
test.adb:5:17: error: no such entity
5 | V : constant Missing_Vector :=
| ^^^^^^^^^^^^^^



Expand Down

0 comments on commit f836232

Please sign in to comment.