parent
3fa2e79814
commit
26eae7d00e
10 changed files with 317 additions and 67 deletions
|
|
@ -1,5 +1,13 @@
|
|||
discard """
|
||||
output: "1"
|
||||
output: '''1
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
yes
|
||||
no'''
|
||||
"""
|
||||
|
||||
# bug #1708
|
||||
|
|
@ -24,3 +32,59 @@ when true:
|
|||
const foo2: seq[string] = @[]
|
||||
|
||||
echo foo[0][0][0]
|
||||
|
||||
proc takeEmpty(x: openArray[string] = []) = discard
|
||||
takeEmpty()
|
||||
takeEmpty([])
|
||||
|
||||
proc takeEmpty2(x: openArray[string] = @[]) = discard
|
||||
takeEmpty2()
|
||||
takeEmpty2([])
|
||||
takeEmpty2(@[])
|
||||
|
||||
#takeEmpty2([nil])
|
||||
|
||||
#rawMessage(errExecutionOfProgramFailed, [])
|
||||
|
||||
# bug #2470
|
||||
const
|
||||
stuff: seq[string] = @[]
|
||||
|
||||
for str in stuff:
|
||||
echo "str=", str
|
||||
|
||||
# bug #1354
|
||||
proc foo4[T](more: seq[T] = @[]) =
|
||||
var more2 = more
|
||||
|
||||
foo4[int]()
|
||||
|
||||
proc maino: int =
|
||||
var wd: cstring = nil
|
||||
inc result
|
||||
|
||||
discard maino()
|
||||
|
||||
proc varargso(a: varargs[string]) =
|
||||
for x in a:
|
||||
echo x
|
||||
|
||||
varargso(["foo", "bar", "baz"])
|
||||
varargso("foo", "bar", "baz")
|
||||
|
||||
|
||||
type
|
||||
Flago = enum
|
||||
tfNeedsInit, tfNotNil
|
||||
|
||||
var s: set[Flago] = {tfNeedsInit}
|
||||
|
||||
if {tfNeedsInit, tfNotNil} * s != {}:
|
||||
echo "yes"
|
||||
else:
|
||||
echo "no"
|
||||
|
||||
if {tfNeedsInit, tfNotNil} * s <= {tfNotNil}:
|
||||
echo "yes"
|
||||
else:
|
||||
echo "no"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue