aboutsummaryrefslogtreecommitdiff
path: root/testsuite/fail_compilation/assign_to_call_result_field.elna
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/fail_compilation/assign_to_call_result_field.elna')
-rw-r--r--testsuite/fail_compilation/assign_to_call_result_field.elna15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/assign_to_call_result_field.elna b/testsuite/fail_compilation/assign_to_call_result_field.elna
new file mode 100644
index 0000000..509b2dd
--- /dev/null
+++ b/testsuite/fail_compilation/assign_to_call_result_field.elna
@@ -0,0 +1,15 @@
+type
+ R = record
+ x: Int
+ end
+
+proc make() -> R
+var
+ result: R
+begin
+ result.x := 1
+return result
+
+begin
+ make().x := 5 (* @Error Expression of type 'Int' is not addressable *)
+end.