From 162bd26be4e47d89f305435f7a1917b023138ed6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 1 Apr 2019 12:46:10 +0200 Subject: pkg/compiler: make buffer alias to ptr[array[int8]] Ptr type has special handling of direction (pointers are always input). But buffer type missed this special case all the time. Make buffer less special by aliasing to the ptr[array[int8]] type. As the result buffer type can't have optional trailing "opt" attribute because we don't have such support for templates yet. Change such cases to use ptr type directly. Fixes #1097 --- pkg/compiler/testdata/errors.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/compiler/testdata/errors.txt') diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index 55ec40901..e95c3be7d 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -71,9 +71,9 @@ resource r9["foo"] ### unexpected string "foo", expect type foo$7(a r0, a1 r2[opt]) foo$8(a fileoff[a, b, c]) ### wrong number of arguments for type fileoff, expect no arguments foo$9(a buffer[inout]) -foo$10(a buffer[intout]) ### unexpected value intout for direction argument of buffer type, expect [in out inout] -foo$11(a buffer["in"]) ### unexpected string "in" for direction argument of buffer type, expect [in out inout] -foo$12(a buffer[10]) ### unexpected int 10 for direction argument of buffer type, expect [in out inout] +foo$10(a buffer[intout]) ### unexpected value intout for direction argument of ptr type, expect [in out inout] +foo$11(a buffer["in"]) ### unexpected string "in" for direction argument of ptr type, expect [in out inout] +foo$12(a buffer[10]) ### unexpected int 10 for direction argument of ptr type, expect [in out inout] foo$13(a int32[2:3]) foo$14(a int32[2:2]) foo$16(a int32[3]) -- cgit mrf-deployment