summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/t8925.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stdlib/t8925.nim b/tests/stdlib/t8925.nim
new file mode 100644
index 000000000..d3dc1ea86
--- /dev/null
+++ b/tests/stdlib/t8925.nim
@@ -0,0 +1,16 @@
+discard """
+  file: "strscans.nim"
+  errormsg: "type mismatch between pattern '$i' (position: 1) and HourRange var 'hour'"
+"""
+
+import strscans
+
+type
+  HourRange = range[0..23]
+
+var
+  hour: HourRange
+  timeStr: string
+
+if scanf(timeStr, "$i", hour):
+  discard
n' href='/ahoang/Nim/blame/compiler.nimble?h=devel&id=5a64e1a53145699f2dfdf86b0c8c3c87ddf2cd8a'>^
1
2
3
4
5
6
7
8
9