Merged
This commit is contained in:
commit
884d5518dd
91 changed files with 991 additions and 733 deletions
|
|
@ -2,8 +2,8 @@ discard """
|
|||
errormsg: "invalid context for '^' as 'foo()' has side effects"
|
||||
line: "9"
|
||||
"""
|
||||
|
||||
proc foo(): seq[int] =
|
||||
# XXX This needs to be fixed properly!
|
||||
proc foo(): seq[int] {.sideEffect.} =
|
||||
echo "ha"
|
||||
|
||||
let f = foo()[^1]
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ when not defined(windows):
|
|||
var rc2 = selector.select(100)
|
||||
assert(len(rc2) == 1)
|
||||
|
||||
var read_count = posix.recv(server2_socket, addr (buffer[0]), 128, 0)
|
||||
var read_count = posix.recv(server2_socket, addr buffer[0], 128, 0)
|
||||
if read_count == -1:
|
||||
raiseOSError(osLastError())
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ when not defined(windows):
|
|||
|
||||
proc mt_event_test(): bool =
|
||||
var
|
||||
thr: array [0..7, Thread[SelectEvent]]
|
||||
thr: array[0..7, Thread[SelectEvent]]
|
||||
var selector = newSelector[int]()
|
||||
var sock = newNativeSocket()
|
||||
var event = newSelectEvent()
|
||||
|
|
@ -317,7 +317,7 @@ else:
|
|||
var rc2 = selector.select(100)
|
||||
assert(len(rc2) == 1)
|
||||
|
||||
var read_count = recv(server2_socket, addr (buffer[0]), 128, 0)
|
||||
var read_count = recv(server2_socket, addr buffer[0], 128, 0)
|
||||
if read_count == -1:
|
||||
raiseOSError(osLastError())
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ else:
|
|||
assert(selector.isEmpty())
|
||||
|
||||
proc mt_event_test(): bool =
|
||||
var thr: array [0..7, Thread[SelectEvent]]
|
||||
var thr: array[0..7, Thread[SelectEvent]]
|
||||
var event = newSelectEvent()
|
||||
for i in 0..high(thr):
|
||||
createThread(thr[i], event_wait_thread, event)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
line: 18
|
||||
errormsg: "type mismatch: got (proc (s: TScgi) | proc (client: AsyncSocket, headers: StringTableRef, input: string){.gcsafe, locks: 0.}"
|
||||
errormsg: "type mismatch: got (proc (s: TScgi) | proc (client: AsyncSocket, headers: StringTableRef, input: string){.noSideEffect, gcsafe, locks: 0.}"
|
||||
"""
|
||||
|
||||
#bug #442
|
||||
|
|
|
|||
26
tests/ccgbugs/twrong_rc_for_refarray.nim
Normal file
26
tests/ccgbugs/twrong_rc_for_refarray.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
discard """
|
||||
output: '''m[0][0] = 1.0
|
||||
m[0][0] = 2.0'''
|
||||
"""
|
||||
# bug #4653
|
||||
type
|
||||
Vector = ref array[2, float64]
|
||||
Matrix = ref array[2, Vector]
|
||||
|
||||
proc newVector(): Vector =
|
||||
new(result)
|
||||
|
||||
proc newMatrix(): Matrix =
|
||||
new(result)
|
||||
for ix in 0 .. 1:
|
||||
result[ix] = newVector()
|
||||
|
||||
let m = newMatrix()
|
||||
|
||||
m[0][0] = 1.0
|
||||
echo "m[0][0] = ", m[0][0]
|
||||
|
||||
GC_fullCollect()
|
||||
|
||||
m[0][0] = 2.0
|
||||
echo "m[0][0] = ", m[0][0]
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import json, tables, sequtils
|
||||
|
||||
proc run(json_params: Table) =
|
||||
proc run(json_params: OrderedTable) =
|
||||
let json_elems = json_params["files"].elems
|
||||
# These fail compilation.
|
||||
var files = map(json_elems, proc (x: JsonNode): string = x.str)
|
||||
|
|
|
|||
|
|
@ -134,6 +134,29 @@ block mpairsTableTest1:
|
|||
block SyntaxTest:
|
||||
var x = toTable[int, string]({:})
|
||||
|
||||
# Until #4448 is fixed, these tests will fail
|
||||
when false:
|
||||
block clearTableTest:
|
||||
var t = data.toTable
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
block clearOrderedTableTest:
|
||||
var t = data.toOrderedTable
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
block clearCountTableTest:
|
||||
var t = initCountTable[string]()
|
||||
t.inc("90", 3)
|
||||
t.inc("12", 2)
|
||||
t.inc("34", 1)
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
proc orderedTableSortTest() =
|
||||
var t = initOrderedTable[string, int](2)
|
||||
for key, val in items(data): t[key] = val
|
||||
|
|
|
|||
|
|
@ -141,6 +141,31 @@ block anonZipTest:
|
|||
let values = @[1, 2, 3]
|
||||
doAssert "{a: 1, b: 2, c: 3}" == $ toTable zip(keys, values)
|
||||
|
||||
block clearTableTest:
|
||||
var t = newTable[string, float]()
|
||||
t["test"] = 1.2345
|
||||
t["111"] = 1.000043
|
||||
t["123"] = 1.23
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
block clearOrderedTableTest:
|
||||
var t = newOrderedTable[string, int](2)
|
||||
for key, val in items(data): t[key] = val
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
block clearCountTableTest:
|
||||
var t = newCountTable[string]()
|
||||
t.inc("90", 3)
|
||||
t.inc("12", 2)
|
||||
t.inc("34", 1)
|
||||
assert t.len() != 0
|
||||
t.clear()
|
||||
assert t.len() == 0
|
||||
|
||||
orderedTableSortTest()
|
||||
echo "true"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ discard """
|
|||
file: "tcurrncy.nim"
|
||||
output: "25"
|
||||
"""
|
||||
template Additive(typ: typeDesc): stmt =
|
||||
template Additive(typ: untyped) =
|
||||
proc `+` *(x, y: typ): typ {.borrow.}
|
||||
proc `-` *(x, y: typ): typ {.borrow.}
|
||||
|
||||
|
|
@ -10,18 +10,18 @@ template Additive(typ: typeDesc): stmt =
|
|||
proc `+` *(x: typ): typ {.borrow.}
|
||||
proc `-` *(x: typ): typ {.borrow.}
|
||||
|
||||
template Multiplicative(typ, base: typeDesc): stmt {.immediate.} =
|
||||
template Multiplicative(typ, base: untyped) =
|
||||
proc `*` *(x: typ, y: base): typ {.borrow.}
|
||||
proc `*` *(x: base, y: typ): typ {.borrow.}
|
||||
proc `div` *(x: typ, y: base): typ {.borrow.}
|
||||
proc `mod` *(x: typ, y: base): typ {.borrow.}
|
||||
|
||||
template Comparable(typ: typeDesc): stmt =
|
||||
template Comparable(typ: untyped) =
|
||||
proc `<` * (x, y: typ): bool {.borrow.}
|
||||
proc `<=` * (x, y: typ): bool {.borrow.}
|
||||
proc `==` * (x, y: typ): bool {.borrow.}
|
||||
|
||||
template DefineCurrency(typ, base: expr): stmt {.immediate.} =
|
||||
template DefineCurrency(typ, base: untyped) =
|
||||
type
|
||||
typ* = distinct base
|
||||
Additive(typ)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
discard """
|
||||
file: "tsidee4.nim"
|
||||
line: 15
|
||||
errormsg: "type mismatch"
|
||||
line: 12
|
||||
errormsg: "'noSideEffect' can have side effects"
|
||||
"""
|
||||
|
||||
var
|
||||
global: int
|
||||
|
||||
proc dontcare(x: int): int = return x
|
||||
proc dontcare(x: int): int = return global
|
||||
|
||||
proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} =
|
||||
return x + y + dontcare(x)
|
||||
|
|
|
|||
13
tests/generics/tlamba_in_generic.nim
Normal file
13
tests/generics/tlamba_in_generic.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
discard """
|
||||
output: '''!!Hi!!'''
|
||||
"""
|
||||
# bug #4658
|
||||
import future
|
||||
|
||||
var x = 123
|
||||
|
||||
proc twice[T](f: T -> T): T -> T = (x: T) => f(f(x))
|
||||
|
||||
proc quote(s: string): string = "!" & s & "!"
|
||||
|
||||
echo twice(quote)("Hi")
|
||||
8
tests/generics/ttempl_in_generic.nim
Normal file
8
tests/generics/ttempl_in_generic.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
# bug #4600
|
||||
template foo(x: untyped): untyped = echo 1
|
||||
template foo(x,y: untyped): untyped = echo 2
|
||||
|
||||
proc bar1[T](x: T) = foo(x)
|
||||
proc bar2(x: float) = foo(x,x)
|
||||
proc bar3[T](x: T) = foo(x,x)
|
||||
33
tests/iter/tcomplex_openarray.nim
Normal file
33
tests/iter/tcomplex_openarray.nim
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
# bug #3221
|
||||
|
||||
import algorithm, math, sequtils
|
||||
|
||||
|
||||
iterator permutations[T](ys: openarray[T]): seq[T] =
|
||||
var
|
||||
d = 1
|
||||
c = newSeq[int](ys.len)
|
||||
xs = newSeq[T](ys.len)
|
||||
for i, y in ys: xs[i] = y
|
||||
yield xs
|
||||
block outer:
|
||||
while true:
|
||||
while d > 1:
|
||||
dec d
|
||||
c[d] = 0
|
||||
while c[d] >= d:
|
||||
inc d
|
||||
if d >= ys.len: break outer
|
||||
let i = if (d and 1) == 1: c[d] else: 0
|
||||
swap xs[i], xs[d]
|
||||
yield xs
|
||||
inc c[d]
|
||||
|
||||
proc dig_vectors(): void =
|
||||
var v_nums: seq[int]
|
||||
v_nums = newSeq[int](1)
|
||||
for perm in permutations(toSeq(0 .. 1)):
|
||||
v_nums[0] = 1
|
||||
|
||||
dig_vectors()
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
discard """
|
||||
output: '''[OK] >:)'''
|
||||
output: '''
|
||||
[Suite] Bacon
|
||||
[OK] >:)'''
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
|
|
|||
67
tests/macros/tgettype2.nim
Normal file
67
tests/macros/tgettype2.nim
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
|
||||
import macros, typetraits
|
||||
|
||||
type Foo = distinct int
|
||||
type Bar = distinct int
|
||||
type Baz = int
|
||||
|
||||
let foo = 0.Foo
|
||||
let bar = 1.Bar
|
||||
let baz = 2.Baz
|
||||
|
||||
type MyType[T] = distinct tuple[a,b:T]
|
||||
type MySimpleType = distinct tuple[a,b: int]
|
||||
|
||||
var v: seq[int]
|
||||
var vv: seq[float]
|
||||
var t: MyType[int]
|
||||
var tt: MyType[float]
|
||||
var s: MySimpleType
|
||||
|
||||
echo "############"
|
||||
echo "#### gt ####"
|
||||
echo "############"
|
||||
|
||||
macro gt(a: typed): string =
|
||||
let b = a.getType
|
||||
var str = "gt(" & $a & "):\t" & b.repr
|
||||
if b.kind == nnkSym: # bad predicat to check weather the type has an implementation
|
||||
str = str & ", " & b.getType.repr # append the implementation to the result
|
||||
result = newLit(str)
|
||||
|
||||
echo gt(Foo) # typeDesc[Foo]
|
||||
echo gt(Bar) # typeDesc[Bar]
|
||||
echo gt(Baz) # typeDesc[int] shouldn't it be typeDesc[Baz]?
|
||||
echo gt(foo) # distinct[int] I would prefer Foo, distinct[int]
|
||||
echo gt(bar) # distinct[int] I would prefer Bar, distinct[int]
|
||||
echo gt(baz) # int, int I would prefer Baz, int
|
||||
|
||||
echo gt(v) # seq[int], ok
|
||||
echo gt(vv) # seq[float], ok
|
||||
echo gt(t) # MyType, distinct[tuple[int, int]] I would prefer MyType[int], distinct[tuple[int, int]]
|
||||
echo gt(tt) # MyType, distinct[tuple[float, float]] I would prefer MyType[float], distinct[tuple[int, int]]
|
||||
echo gt(s) # distinct[tuple[int, int]] I would prefer MySimpleType, distinct[tuple[int,int]]
|
||||
|
||||
echo "#############"
|
||||
echo "#### gt2 ####"
|
||||
echo "#############"
|
||||
|
||||
# get type name via typetraits
|
||||
|
||||
macro gt2(a: typed): string =
|
||||
let prefix = "gt2(" & $a & "): \t"
|
||||
result = quote do:
|
||||
`prefix` & `a`.type.name
|
||||
|
||||
echo gt2(Foo) # Foo shouldn't this be typeDesc[Foo] ?
|
||||
echo gt2(Bar) # Bar shouldn't this be typeDesc[Bar] ?
|
||||
echo gt2(Baz) # Baz shouldn't this be typeDesc[Baz] ?
|
||||
echo gt2(foo) # Foo
|
||||
echo gt2(bar) # Bar
|
||||
echo gt2(baz) # Baz
|
||||
|
||||
echo gt2(v) # seq[int]
|
||||
echo gt2(vv) # seq[float]
|
||||
echo gt2(t) # MyType[system.int] why is it system.int and not just int like in seq?
|
||||
echo gt2(tt) # MyType[system.float] why is it system.float and not just float like in seq?
|
||||
echo gt2(s) # MySimpleType
|
||||
43
tests/metatype/twildtypedesc.nim
Normal file
43
tests/metatype/twildtypedesc.nim
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
discard """
|
||||
output: '''123
|
||||
123
|
||||
123
|
||||
123
|
||||
123
|
||||
123'''
|
||||
"""
|
||||
|
||||
import strutils
|
||||
|
||||
proc unpack(t: typedesc[string], v: string): string = $v
|
||||
proc unpack(t: typedesc[int], v: string): int = parseInt(v)
|
||||
|
||||
proc unpack[T](v: string): T =
|
||||
unpack T, v
|
||||
|
||||
var s = "123"
|
||||
|
||||
assert(unpack[string](s) is string)
|
||||
assert(unpack[int](s) is int)
|
||||
|
||||
echo unpack[int](s)
|
||||
echo unpack[string](s)
|
||||
|
||||
echo unpack(int,s)
|
||||
echo unpack(string,s)
|
||||
|
||||
template `as`*(x: untyped, t: typedesc): untyped = unpack(t,x)
|
||||
|
||||
echo s as int
|
||||
echo s as string
|
||||
|
||||
# bug #4534
|
||||
|
||||
proc unit(t: typedesc[int]): t = 0
|
||||
proc unit(t: typedesc[string]): t = ""
|
||||
proc unit(t: typedesc[float]): t = 0.0
|
||||
|
||||
assert unit(int) == 0
|
||||
assert unit(string) == ""
|
||||
assert unit(float) == 0.0
|
||||
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
discard """
|
||||
action: run
|
||||
output: '''
|
||||
[Suite] inet_ntop tests
|
||||
'''
|
||||
"""
|
||||
|
||||
when defined(windows):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
discard """
|
||||
action: run
|
||||
output: '''
|
||||
[Suite] parseutils'''
|
||||
"""
|
||||
import unittest, strutils
|
||||
|
||||
|
|
|
|||
|
|
@ -39,55 +39,49 @@ doAssert t4.format("M MM MMM MMMM") == "10 10 Oct October"
|
|||
doAssert((t4 - initInterval(years = 2)).format("yyyy") == "1995")
|
||||
doAssert((t4 - initInterval(years = 7, minutes = 34, seconds = 24)).format("yyyy mm ss") == "1990 24 10")
|
||||
|
||||
var s = "Tuesday at 09:04am on Dec 15, 2015"
|
||||
var f = "dddd at hh:mmtt on MMM d, yyyy"
|
||||
doAssert($s.parse(f) == "Tue Dec 15 09:04:00 2015")
|
||||
proc parseTest(s, f, sExpected: string, ydExpected: int) =
|
||||
let parsed = s.parse(f)
|
||||
doAssert($parsed == sExpected)
|
||||
doAssert(parsed.yearday == ydExpected)
|
||||
proc parseTestTimeOnly(s, f, sExpected: string) =
|
||||
doAssert(sExpected in $s.parse(f))
|
||||
|
||||
parseTest("Tuesday at 09:04am on Dec 15, 2015",
|
||||
"dddd at hh:mmtt on MMM d, yyyy", "Tue Dec 15 09:04:00 2015", 348)
|
||||
# ANSIC = "Mon Jan _2 15:04:05 2006"
|
||||
s = "Thu Jan 12 15:04:05 2006"
|
||||
f = "ddd MMM dd HH:mm:ss yyyy"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Thu Jan 12 15:04:05 2006", "ddd MMM dd HH:mm:ss yyyy",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
# UnixDate = "Mon Jan _2 15:04:05 MST 2006"
|
||||
s = "Thu Jan 12 15:04:05 MST 2006"
|
||||
f = "ddd MMM dd HH:mm:ss ZZZ yyyy"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Thu Jan 12 15:04:05 MST 2006", "ddd MMM dd HH:mm:ss ZZZ yyyy",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
# RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
|
||||
s = "Thu Jan 12 15:04:05 -07:00 2006"
|
||||
f = "ddd MMM dd HH:mm:ss zzz yyyy"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Mon Feb 29 15:04:05 -07:00 2016", "ddd MMM dd HH:mm:ss zzz yyyy",
|
||||
"Mon Feb 29 15:04:05 2016", 59) # leap day
|
||||
# RFC822 = "02 Jan 06 15:04 MST"
|
||||
s = "12 Jan 16 15:04 MST"
|
||||
f = "dd MMM yy HH:mm ZZZ"
|
||||
doAssert($s.parse(f) == "Tue Jan 12 15:04:00 2016")
|
||||
parseTest("12 Jan 16 15:04 MST", "dd MMM yy HH:mm ZZZ",
|
||||
"Tue Jan 12 15:04:00 2016", 11)
|
||||
# RFC822Z = "02 Jan 06 15:04 -0700" # RFC822 with numeric zone
|
||||
s = "12 Jan 16 15:04 -07:00"
|
||||
f = "dd MMM yy HH:mm zzz"
|
||||
doAssert($s.parse(f) == "Tue Jan 12 15:04:00 2016")
|
||||
parseTest("01 Mar 16 15:04 -07:00", "dd MMM yy HH:mm zzz",
|
||||
"Tue Mar 1 15:04:00 2016", 60) # day after february in leap year
|
||||
# RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
|
||||
s = "Monday, 12-Jan-06 15:04:05 MST"
|
||||
f = "dddd, dd-MMM-yy HH:mm:ss ZZZ"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Monday, 12-Jan-06 15:04:05 MST", "dddd, dd-MMM-yy HH:mm:ss ZZZ",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
# RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
|
||||
s = "Thu, 12 Jan 2006 15:04:05 MST"
|
||||
f = "ddd, dd MMM yyyy HH:mm:ss ZZZ"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Sun, 01 Mar 2015 15:04:05 MST", "ddd, dd MMM yyyy HH:mm:ss ZZZ",
|
||||
"Sun Mar 1 15:04:05 2015", 59) # day after february in non-leap year
|
||||
# RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" # RFC1123 with numeric zone
|
||||
s = "Thu, 12 Jan 2006 15:04:05 -07:00"
|
||||
f = "ddd, dd MMM yyyy HH:mm:ss zzz"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("Thu, 12 Jan 2006 15:04:05 -07:00", "ddd, dd MMM yyyy HH:mm:ss zzz",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
# RFC3339 = "2006-01-02T15:04:05Z07:00"
|
||||
s = "2006-01-12T15:04:05Z-07:00"
|
||||
f = "yyyy-MM-ddTHH:mm:ssZzzz"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
f = "yyyy-MM-dd'T'HH:mm:ss'Z'zzz"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("2006-01-12T15:04:05Z-07:00", "yyyy-MM-ddTHH:mm:ssZzzz",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
parseTest("2006-01-12T15:04:05Z-07:00", "yyyy-MM-dd'T'HH:mm:ss'Z'zzz",
|
||||
"Thu Jan 12 15:04:05 2006", 11)
|
||||
# RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
|
||||
s = "2006-01-12T15:04:05.999999999Z-07:00"
|
||||
f = "yyyy-MM-ddTHH:mm:ss.999999999Zzzz"
|
||||
doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
|
||||
parseTest("2006-01-12T15:04:05.999999999Z-07:00",
|
||||
"yyyy-MM-ddTHH:mm:ss.999999999Zzzz", "Thu Jan 12 15:04:05 2006", 11)
|
||||
# Kitchen = "3:04PM"
|
||||
s = "3:04PM"
|
||||
f = "h:mmtt"
|
||||
doAssert "15:04:00" in $s.parse(f)
|
||||
parseTestTimeOnly("3:04PM", "h:mmtt", "15:04:00")
|
||||
#when not defined(testing):
|
||||
# echo "Kitchen: " & $s.parse(f)
|
||||
# var ti = timeToTimeInfo(getTime())
|
||||
|
|
|
|||
9
tests/template/ttemp_in_varargs.nim
Normal file
9
tests/template/ttemp_in_varargs.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
output: '''a'''
|
||||
"""
|
||||
|
||||
# bug #4292
|
||||
|
||||
template foo(s: string): string = s
|
||||
proc variadicProc*(v: varargs[string, foo]) = echo v[0]
|
||||
variadicProc("a")
|
||||
3
tests/vm/tconst_float_as_int.nim
Normal file
3
tests/vm/tconst_float_as_int.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
# bug #4619
|
||||
const x: float = 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue