mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
18 lines
294 B
Nim
18 lines
294 B
Nim
discard """
|
|
cmd: "nim c --newRuntime $file"
|
|
output: "1"
|
|
"""
|
|
|
|
proc viewInto(a: array[4, string]): lent string =
|
|
result = a[0]
|
|
|
|
proc passToVar(x: var string) =
|
|
discard
|
|
|
|
proc main =
|
|
let x = ["1", "2", "3", "4"]
|
|
echo viewInto(x)
|
|
doAssert(not compiles(passToVar(viewInto(x))))
|
|
|
|
main()
|