mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
17 lines
260 B
Nim
17 lines
260 B
Nim
discard """
|
|
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()
|