aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/v/tests/const_reference_argument_test.v
diff options
context:
space:
mode:
Diffstat (limited to 'v_windows/v/vlib/v/tests/const_reference_argument_test.v')
-rw-r--r--v_windows/v/vlib/v/tests/const_reference_argument_test.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/tests/const_reference_argument_test.v b/v_windows/v/vlib/v/tests/const_reference_argument_test.v
new file mode 100644
index 0000000..079afc2
--- /dev/null
+++ b/v_windows/v/vlib/v/tests/const_reference_argument_test.v
@@ -0,0 +1,9 @@
+fn a_const_accepting_fn(x &int, const_x &int) int {
+ return *x + *const_x
+}
+
+fn test_fn_with_const_ref_param_can_be_called() {
+ a := 1
+ b := 2
+ assert a_const_accepting_fn(&a, &b) == 3
+}