Skip to content

Commit

Permalink
Handle classwide types with limited specific type in is_limited_type.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roldak committed May 13, 2024
1 parent dd73eab commit d04e70f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ada/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -7826,6 +7826,7 @@ def is_limited_type():
lambda td=TypeDecl: td.type_def.is_limited_type,
lambda sb=SubtypeDecl: sb.get_type.is_limited_type,
lambda it=IncompleteTypeDecl: it.full_view.is_limited_type,
lambda cw=ClasswideTypeDecl: cw.type_decl.is_limited_type,
lambda _=ProtectedTypeDecl: True,
lambda _=TaskTypeDecl: True,
lambda _: False
Expand Down
3 changes: 3 additions & 0 deletions testsuite/tests/properties/is_limited_type/test.adb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ procedure Test is
type Non_Limited_From_Limited_Interface is new Limited_Interface
with null record;
--% node.p_is_limited_type

subtype Classwide_Type is Limited_Tagged_Rec'Class;
--% node.p_is_limited_type
begin
null;
end Test;
6 changes: 6 additions & 0 deletions testsuite/tests/properties/is_limited_type/test.out
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ Working on node <ConcreteTypeDecl ["Non_Limited_From_Limited_Interface"] test.ad

Eval 'node.p_is_limited_type'
Result: False

Working on node <SubtypeDecl ["Classwide_Type"] test.adb:51:4-51:55>
====================================================================

Eval 'node.p_is_limited_type'
Result: True

0 comments on commit d04e70f

Please sign in to comment.