Skip to content

Commit de5959c

Browse files
committed
Merge branch 'topic/fix_no_inherited_pre' into 'master'
Add a testcase for private overrides in "No_Inherited_Classwide_Pre" Closes #375 See merge request eng/libadalang/langkit-query-language!319
2 parents 5075ab5 + a12701b commit de5959c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

testsuite/tests/checks/no_inherited_classwide_pre/class.ads

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ package Class is
1010
type T is tagged private;
1111

1212
type NT1 is new T and Int with private;
13-
function Test (X : NT1) return Boolean; -- FLAG
14-
procedure Proc (X : in out NT1); -- NOFLAG
13+
function Test (X : NT1) return Boolean; -- FLAG
14+
procedure Proc (X : in out NT1); -- NOFLAG
1515

1616
type NT2 is new T and Int1 with private;
17-
procedure Proc (X : in out NT2); -- FLAG
17+
procedure Proc (X : in out NT2); -- FLAG
1818

1919
private
2020
type T is tagged record
@@ -24,4 +24,7 @@ private
2424
type NT1 is new T and Int with null record;
2525
type NT2 is new T and Int1 with null record;
2626

27+
type PT is new T and Int1 with null record;
28+
procedure Proc (X : in out PT) is null; -- FLAG
29+
2730
end Class;

testsuite/tests/checks/no_inherited_classwide_pre/test.out

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ class.adb:15:14: rule violation: overriding operation that does not inherit Pre'
33
| ^^^^
44

55
class.ads:13:13: rule violation: overriding operation that does not inherit Pre'Class (class.ads:4:4)
6-
13 | function Test (X : NT1) return Boolean; -- FLAG
6+
13 | function Test (X : NT1) return Boolean; -- FLAG
77
| ^^^^
88

99
class.ads:17:14: rule violation: overriding operation that does not inherit Pre'Class (class.ads:8:4)
10-
17 | procedure Proc (X : in out NT2); -- FLAG
10+
17 | procedure Proc (X : in out NT2); -- FLAG
11+
| ^^^^
12+
13+
class.ads:28:14: rule violation: overriding operation that does not inherit Pre'Class (class.ads:8:4)
14+
28 | procedure Proc (X : in out PT) is null; -- FLAG
1115
| ^^^^
1216

0 commit comments

Comments
 (0)