summary refs log tree commit diff stats
path: root/tests/int/twrongexplicitvarconv.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/int/twrongexplicitvarconv.nim')
-rw-r--r--tests/int/twrongexplicitvarconv.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/int/twrongexplicitvarconv.nim b/tests/int/twrongexplicitvarconv.nim
new file mode 100644
index 000000000..79f770e8e
--- /dev/null
+++ b/tests/int/twrongexplicitvarconv.nim
@@ -0,0 +1,16 @@
+discard """
+  action: reject
+  nimout: '''
+  but expression 'int(a)' is immutable, not 'var'
+'''
+"""
+
+proc `++`(n: var int) =
+  n += 1
+
+var a: int32 = 15
+
+++int(a) #[tt.Error
+^ type mismatch: got <int>]#
+
+echo a