mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-27 07:18:15 +00:00
SSO strings: bugfix (#25810)
This commit is contained in:
13
tests/errmsgs/tsso_string_index_var.nim
Normal file
13
tests/errmsgs/tsso_string_index_var.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
cmd: "nim check --strings:sso --mm:orc --hints:off $file"
|
||||
action: "reject"
|
||||
nimout: '''
|
||||
tsso_string_index_var.nim(13, 12) Error: expression 's[0]' is immutable, not 'var'
|
||||
'''
|
||||
"""
|
||||
|
||||
proc passByVar(c: var char) =
|
||||
c = 'x'
|
||||
|
||||
var s = "abc"
|
||||
passByVar(s[0])
|
||||
Reference in New Issue
Block a user