mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* alternative, much simpler algorithm for strict func checking * forgot to git add new compiler module * new spec is incredibly simple to describe * fixes bigints regression * typos * closes #16305; closes #17387; closes #20863
20 lines
270 B
Nim
20 lines
270 B
Nim
discard """
|
|
errormsg: '''cannot mutate location x.data within a strict func'''
|
|
line: 15
|
|
"""
|
|
|
|
{.experimental: "strictFuncs".}
|
|
|
|
# bug #15508
|
|
|
|
type
|
|
MyType = ref object
|
|
data: string
|
|
|
|
func edit(x: MyType) =
|
|
x.data = "hello"
|
|
|
|
let x = MyType()
|
|
x.edit()
|
|
echo x.data
|