Merge pull request #8937 from Vindaar/fixes-8925

fix #8925 by using `getTypeInst` instead of `getType`
This commit is contained in:
Andreas Rumpf 2018-09-18 09:37:39 +02:00 • committed by GitHub
commit 597acad507
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

16
tests/stdlib/t8925.nim Normal file
View file

@ -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