* fixes `@[]` type inference in generics * add issue links * fixes macros and iterators * refactor * add one more test
This commit is contained in:
parent
2d9af2bd55
commit
64a0355f3f
4 changed files with 51 additions and 5 deletions
|
|
@ -245,7 +245,7 @@ block: # bug #11777
|
|||
var s: S = {1, 2}
|
||||
doAssert 1 in s
|
||||
|
||||
block: # regression #20807
|
||||
block: # bug #20807
|
||||
var s: seq[string]
|
||||
template fail =
|
||||
s = @[]
|
||||
|
|
@ -255,3 +255,38 @@ block: # regression #20807
|
|||
test: fail()
|
||||
doAssert not (compiles do:
|
||||
let x: seq[int] = `@`[string]([]))
|
||||
|
||||
block: # bug #21377
|
||||
proc b[T](v: T): seq[int] =
|
||||
let x = 0
|
||||
@[]
|
||||
|
||||
doAssert b(0) == @[]
|
||||
|
||||
block: # bug #21377
|
||||
proc b[T](v: T): seq[T] =
|
||||
let x = 0
|
||||
@[]
|
||||
|
||||
doAssert b(0) == @[]
|
||||
|
||||
block: # bug #21377
|
||||
proc b[T](v: T): set[bool] =
|
||||
let x = 0
|
||||
{}
|
||||
|
||||
doAssert b(0) == {}
|
||||
|
||||
block: # bug #21377
|
||||
proc b[T](v: T): array[0, int] =
|
||||
let x = 0
|
||||
[]
|
||||
|
||||
doAssert b(0) == []
|
||||
|
||||
block: # bug #21377
|
||||
proc b[T](v: T): array[0, (string, string)] =
|
||||
let x = 0
|
||||
{:}
|
||||
|
||||
doAssert b(0) == {:}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue