Skip to content

Commit

Permalink
test: add unit test for recursion during lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Oct 31, 2023
1 parent b84312e commit 4900c6c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
main: () = {
a: type == b;
b: type == a;
_ = a::t;
_ = b::t;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp: In function ‘int main()’:
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:19:13: error: ‘b’ does not name a type
19 | using a = b;
| ^
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:20:13: error: ‘a’ does not name a type
20 | using b = a;
| ^
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:21:21: error: ‘a’ has not been declared
21 | static_cast<void>(a::t);
| ^
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:22:21: error: ‘b’ has not been declared
22 | static_cast<void>(b::t);
| ^
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

#define CPP2_IMPORT_STD Yes

//=== Cpp2 type declarations ====================================================


#include "cpp2util.h"



//=== Cpp2 type definitions and function declarations ===========================

auto main() -> int;


//=== Cpp2 function definitions =================================================

auto main() -> int{
using a = b;
using b = a;
static_cast<void>(a::t);
static_cast<void>(b::t);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pure2-bugfix-for-dependent-types-recursion.cpp2... ok (all Cpp2, passes safety checks)

0 comments on commit 4900c6c

Please sign in to comment.