From 3dda7e67688077f3c6f91450d18dc14c776d3872 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 3 May 2020 14:15:26 +0200 Subject: pkg/compiler: simplify and enhance handling of builtins Currently we have special support for each type of builtin node. This is complex and does not scale (we may want other types in future). Prepend the builtin descriptions to the user descriptions instead. This requires a bit of special support, like not reporting any builtin descriptions as unused, but otherwise much simpler and more flexible. Does not produce any diff in generated descriptions. --- pkg/compiler/testdata/errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/compiler/testdata') diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index 6b9145fd6..cc0f47508 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -12,7 +12,7 @@ resource r0[int32]: 0, 0x1 resource r1[string["foo"]] ### string can't be resource base (int types can) resource r1[int32] ### type r1 redeclared, previously declared as resource at LOCATION resource int32[int32] ### resource name int32 conflicts with builtin type -resource fileoff[intptr] ### resource name fileoff conflicts with builtin type +resource fileoff[intptr] ### type fileoff redeclared, previously declared as type alias at builtins s1 { f1 int32 @@ -247,7 +247,7 @@ type type12 proc[123, 2, int16, opt] type type13 ptr[in, typestruct13] type type14 flags[type0, int32] type type15 const[0, type0] ### unexpected value type0 for base type argument of const type, expect [int8 int16 int32 int64 int16be int32be int64be intptr] -type bool8 int8[0:1] ### type name bool8 conflicts with builtin type +type bool8 int8[0:1] ### type bool8 redeclared, previously declared as type alias at builtins typestruct11 { f type11 ### unknown type type11 -- cgit mrf-deployment