fix #19678 Broken behavior with string ranges in case labels (#20475)

* fix #19678 Broken behavior with string ranges in case labels

* Update compiler/semtypes.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Bung 2022-10-02 00:17:07 +08:00 • committed by GitHub
commit cbd9fee22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

17
tests/range/t19678.nim Normal file
View file

@ -0,0 +1,17 @@
discard """
cmd: "nim check --hints:off $file"
errormsg: ""
nimout: '''
t19678.nim(13, 13) Error: range of string is invalid
'''
"""
case "5":
of "0" .. "9":
discard
else:
discard