From 9bf815e7e9851cfcb359116b21f67aed20c598bf Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 18 Apr 2024 11:17:49 +0100 Subject: [PATCH] Add test case for issue #651 --- .../verona_nostdlib/issues/651/651.verona | 3 + .../issues/651/651_out/00_parse.trieste | 33 +++++++++ .../issues/651/651_out/01_modules.trieste | 42 +++++++++++ .../issues/651/651_out/02_structure.trieste | 70 +++++++++++++++++++ .../verona_nostdlib/issues/651/651_out/ast | 70 +++++++++++++++++++ .../issues/651/651_out/exit_code.txt | 1 + .../issues/651/651_out/stderr.txt | 0 .../issues/651/651_out/stdout.txt | 8 +++ 8 files changed, 227 insertions(+) create mode 100644 testsuite/verona_nostdlib/issues/651/651.verona create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/00_parse.trieste create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/01_modules.trieste create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/02_structure.trieste create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/ast create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/exit_code.txt create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/stderr.txt create mode 100644 testsuite/verona_nostdlib/issues/651/651_out/stdout.txt diff --git a/testsuite/verona_nostdlib/issues/651/651.verona b/testsuite/verona_nostdlib/issues/651/651.verona new file mode 100644 index 000000000..cc9c60a3f --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651.verona @@ -0,0 +1,3 @@ +type Copyable[Self] = { // This loops forever due to parameter name self + copy(self: Self) : Self +} & (Self < Copyable[Self]) diff --git a/testsuite/verona_nostdlib/issues/651/651_out/00_parse.trieste b/testsuite/verona_nostdlib/issues/651/651_out/00_parse.trieste new file mode 100644 index 000000000..635e98963 --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/00_parse.trieste @@ -0,0 +1,33 @@ +Verona +parse +(top + {} + (file + (equals + (group + (typealias + {}) + (ident 8:Copyable) + (square + (group + (Self)))) + (group + (brace + (group + (ident 4:copy) + (paren + (group + (ident 4:self) + (colon) + (Self))) + (colon) + (Self))) + (symbol 1:&) + (paren + (group + (Self) + (symbol 1:<) + (ident 8:Copyable) + (square + (group + (Self))))))))) diff --git a/testsuite/verona_nostdlib/issues/651/651_out/01_modules.trieste b/testsuite/verona_nostdlib/issues/651/651_out/01_modules.trieste new file mode 100644 index 000000000..df97497ec --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/01_modules.trieste @@ -0,0 +1,42 @@ +Verona +modules +(top + {} + (group + (class + {}) + (ident 3:651) + (brace + (group + (use) + (ident 3:std) + (doublecolon) + (ident 7:builtin)) + (equals + (group + (typealias + {}) + (ident 8:Copyable) + (square + (group + (Self)))) + (group + (brace + (group + (ident 4:copy) + (paren + (group + (ident 4:self) + (type + (Self)))) + (type + (Self)))) + (symbol 1:&) + (paren + (group + (Self) + (symbol 1:<) + (ident 8:Copyable) + (square + (group + (Self)))))))))) diff --git a/testsuite/verona_nostdlib/issues/651/651_out/02_structure.trieste b/testsuite/verona_nostdlib/issues/651/651_out/02_structure.trieste new file mode 100644 index 000000000..1837e7d1a --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/02_structure.trieste @@ -0,0 +1,70 @@ +Verona +structure +(top + { + 651 = class} + (class + { + Copyable = typealias + include 651} + (ident 3:651) + (typeparams) + (inherit + (dontcare)) + (typepred + (type + (typetrue))) + (classbody + (use + (type + (ident 3:std) + (doublecolon) + (ident 7:builtin))) + (typealias + { + trait$0 = typetrait} + (ident 8:Copyable) + (typeparams + (error + (errormsg 46:Expected a type parameter or a value parameter) + (group + (Self)))) + (typepred + (type + (typetrue))) + (type + (typetrait + { + copy = function} + (ident 7:trait$0) + (classbody + (function + { + self = param} + (explicit) + (rhs) + (ident 4:copy) + (typeparams) + (params + (param + (ident 4:self) + (type + (Self)) + (dontcare))) + (type + (Self)) + (dontcare) + (typepred + (type + (typetrue))) + (dontcare)))) + (symbol 1:&) + (type + (typetuple + (type + (Self) + (symbol 1:<) + (ident 8:Copyable) + (typeargs + (type + (Self))))))))))) diff --git a/testsuite/verona_nostdlib/issues/651/651_out/ast b/testsuite/verona_nostdlib/issues/651/651_out/ast new file mode 100644 index 000000000..1837e7d1a --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/ast @@ -0,0 +1,70 @@ +Verona +structure +(top + { + 651 = class} + (class + { + Copyable = typealias + include 651} + (ident 3:651) + (typeparams) + (inherit + (dontcare)) + (typepred + (type + (typetrue))) + (classbody + (use + (type + (ident 3:std) + (doublecolon) + (ident 7:builtin))) + (typealias + { + trait$0 = typetrait} + (ident 8:Copyable) + (typeparams + (error + (errormsg 46:Expected a type parameter or a value parameter) + (group + (Self)))) + (typepred + (type + (typetrue))) + (type + (typetrait + { + copy = function} + (ident 7:trait$0) + (classbody + (function + { + self = param} + (explicit) + (rhs) + (ident 4:copy) + (typeparams) + (params + (param + (ident 4:self) + (type + (Self)) + (dontcare))) + (type + (Self)) + (dontcare) + (typepred + (type + (typetrue))) + (dontcare)))) + (symbol 1:&) + (type + (typetuple + (type + (Self) + (symbol 1:<) + (ident 8:Copyable) + (typeargs + (type + (Self))))))))))) diff --git a/testsuite/verona_nostdlib/issues/651/651_out/exit_code.txt b/testsuite/verona_nostdlib/issues/651/651_out/exit_code.txt new file mode 100644 index 000000000..56a6051ca --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/exit_code.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/testsuite/verona_nostdlib/issues/651/651_out/stderr.txt b/testsuite/verona_nostdlib/issues/651/651_out/stderr.txt new file mode 100644 index 000000000..e69de29bb diff --git a/testsuite/verona_nostdlib/issues/651/651_out/stdout.txt b/testsuite/verona_nostdlib/issues/651/651_out/stdout.txt new file mode 100644 index 000000000..0bb53356b --- /dev/null +++ b/testsuite/verona_nostdlib/issues/651/651_out/stdout.txt @@ -0,0 +1,8 @@ +Errors: +Expected a type parameter or a value parameter +-- 651.verona:1:15 +type Copyable[Self] = { // This loops forever due to parameter name self + ~~~~ + +Pass structure failed with 1 error! +