From 885f5843663a1f3f2f2f059978d51725f8e803ef Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 13 Nov 2023 12:09:36 +0100 Subject: compiler: prohibit homonymous flags and consts Since both flags and consts can be used as type-options for integers, we want to avoid ambiguity by preventing a flag and a const from having the same name. Signed-off-by: Paul Chaignon --- pkg/compiler/testdata/errors2.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/compiler/testdata') diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index e583094fa..1120f55ad 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -383,6 +383,9 @@ type type500 proc[C1, 8, int8] ### values starting from 1 with step 8 overflow b type type501 int8 ### unused type type501 type type502[C] const[C, int8] ### unused type type502 +C2 = 0, 1, 2 ### const C2 is already a flag +use_flags(a flags[C2]) + s405 { f1 int16:8[-256:0] ### int range [18446744073709551360:0] is too large for base type of size 8 f2 int16:8[0:256] ### int range [0:256] is too large for base type of size 8 -- cgit mrf-deployment