-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace type variables in a single sweep during reification.
Fixes #1875
- Loading branch information
Showing
2 changed files
with
117 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <gtest/gtest.h> | ||
#include <platform.h> | ||
|
||
#include <ast/ast.h> | ||
|
||
#include "util.h" | ||
|
||
#define TEST_COMPILE(src) DO(test_compile(src, "expr")) | ||
#define TEST_ERROR(src) DO(test_error(src, "expr")) | ||
#define TEST_EQUIV(src, expect) DO(test_equiv(src, "expr", expect, "expr")) | ||
|
||
class TypeParamsTest : public PassTest | ||
{}; | ||
|
||
TEST_F(TypeParamsTest, ReifySimultaneously) | ||
{ | ||
// From issue #1870 | ||
const char* src = | ||
"interface State[S, I, O]\n" | ||
" fun val apply(state: S, input: I): (S, O)\n" | ||
" fun val bind[O2](next: State[S, O, O2]): State[S, I, O2]\n"; | ||
|
||
TEST_COMPILE(src); | ||
} |