aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable/generic_alias.elna
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/compilable/generic_alias.elna')
-rw-r--r--testsuite/compilable/generic_alias.elna31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/compilable/generic_alias.elna b/testsuite/compilable/generic_alias.elna
new file mode 100644
index 0000000..3b431be
--- /dev/null
+++ b/testsuite/compilable/generic_alias.elna
@@ -0,0 +1,31 @@
+type
+ File = record
+ fd: Int
+ end
+
+ Node#[T] = record
+ next: ^Node#[T];
+ value: T
+ end
+
+ Ref#[T] = ^T
+
+ Boxed#[V] = record
+ inner: ^Node#[V]
+ end
+
+var
+ chain: Node#[^File]
+ aliased: Ref#[^File]
+ raw: ^^File
+ boxed: Boxed#[^File]
+
+program()
+begin
+ chain.next := nil;
+ aliased := raw;
+ raw := aliased;
+ boxed.inner := @chain
+return 0u8
+
+end.