Skip to content

Commit 84d6972

Browse files
committed
Merge branch 'topic/491' into 'master'
Fix implicit_small_for_fixed_point_types rule Closes #491 See merge request eng/libadalang/langkit-query-language!455
2 parents 02f4735 + 64fb720 commit 84d6972

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

lkql_checker/share/lkql/implicit_small_for_fixed_point_types.lkql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ fun implicit_small_for_fixed_point_types(node) =
2222
|" end Foo;
2323
node is TypeDecl(any children: OrdinaryFixedPointDef,
2424
p_has_aspect("Small"): false)
25+
and node is not FormalTypeDecl
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
procedure Small is
2+
type T1 is delta 0.01 range -1.0 .. 1.0; -- FLAG
3+
type T2 is delta 0.01 range -1.0 .. 1.0; -- NOFLAG
4+
5+
generic
6+
type T3 is delta <>; -- NOFLAG
7+
package G is
8+
end G;
9+
10+
for T2'Small use 0.01;
11+
begin
12+
null;
13+
end Small;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
small.adb:2:9: rule violation: fixed point type declaration with no 'Small clause
2+
2 | type T1 is delta 0.01 range -1.0 .. 1.0; -- FLAG
3+
| ^^
4+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
driver: 'checker'
2+
rule_name: implicit_small_for_fixed_point_types
3+
input_sources: ['small.adb']

0 commit comments

Comments
 (0)