mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
22 lines
294 B
Nim
22 lines
294 B
Nim
discard """
|
|
output: '''string literal
|
|
no string literal
|
|
no string literal'''
|
|
"""
|
|
|
|
proc optLit(a: string{lit}) =
|
|
echo "string literal"
|
|
|
|
proc optLit(a: string) =
|
|
echo "no string literal"
|
|
|
|
const
|
|
constant = "abc"
|
|
|
|
var
|
|
variable = "xyz"
|
|
|
|
optLit("literal")
|
|
optLit(constant)
|
|
optLit(variable)
|