aboutsummaryrefslogtreecommitdiff
path: root/testsuite/fail_compilation/generic_base_mismatch.elna
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/fail_compilation/generic_base_mismatch.elna')
-rw-r--r--testsuite/fail_compilation/generic_base_mismatch.elna26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/generic_base_mismatch.elna b/testsuite/fail_compilation/generic_base_mismatch.elna
new file mode 100644
index 0000000..64e0c40
--- /dev/null
+++ b/testsuite/fail_compilation/generic_base_mismatch.elna
@@ -0,0 +1,26 @@
+type
+ File = record
+ fd: Int
+ end
+ Socket = record
+ handle: Int
+ end
+
+ List#[T] = record
+ head: T
+ end
+
+ Queue#[T] = record(List#[T])
+ tail: T
+ end
+
+var
+ jobs: Queue#[^File]
+ wrong: ^List#[^Socket]
+
+program()
+begin
+ wrong := @jobs (* @Error Expected type '\^List#\[\^Socket\]', but got '\^Queue#\[\^File\]' *)
+return 0u8
+
+end.