mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 05:23:20 +00:00
@@ -463,14 +463,3 @@ proc putValue[T](n: T) =
|
||||
echo b.n
|
||||
|
||||
useForward()
|
||||
|
||||
|
||||
# bug #16246
|
||||
|
||||
proc testWeirdTypeAliases() =
|
||||
var values = newSeq[cuint](8)
|
||||
# var values: seq[cuint] does not produce codegen error
|
||||
var drawCb = proc(): seq[uint32] =
|
||||
result = newSeq[uint32](10)
|
||||
|
||||
testWeirdTypeAliases()
|
||||
|
||||
43
tests/ccgbugs/tctypes.nim
Normal file
43
tests/ccgbugs/tctypes.nim
Normal file
@@ -0,0 +1,43 @@
|
||||
discard """
|
||||
targets: "c cpp"
|
||||
matrix: "--gc:refc; --gc:arc"
|
||||
"""
|
||||
|
||||
# bug #7308
|
||||
proc foo(x: seq[int32]) =
|
||||
var y = newSeq[cint](1)
|
||||
|
||||
proc bar =
|
||||
var t = newSeq[int32](1)
|
||||
foo(t)
|
||||
|
||||
bar()
|
||||
|
||||
|
||||
# bug #16246
|
||||
|
||||
proc testWeirdTypeAliases() =
|
||||
var values = newSeq[cuint](8)
|
||||
# var values: seq[cuint] does not produce codegen error
|
||||
var drawCb = proc(): seq[uint32] =
|
||||
result = newSeq[uint32](10)
|
||||
|
||||
testWeirdTypeAliases()
|
||||
|
||||
block: # bug #11797
|
||||
block:
|
||||
type cdouble2 = cdouble
|
||||
type Foo1 = seq[cdouble]
|
||||
type Foo2 = seq[cdouble2]
|
||||
static: doAssert Foo1 is Foo2
|
||||
var a1: Foo1
|
||||
var a2: Foo2
|
||||
doAssert a1 == @[]
|
||||
doAssert a2 == @[]
|
||||
|
||||
block:
|
||||
proc foo[T: int|cint](fun: proc(): T) = discard
|
||||
proc foo1(): cint = 1
|
||||
proc foo3(): int32 = 2
|
||||
foo(proc(): cint = foo1())
|
||||
foo(proc(): int32 = foo3())
|
||||
Reference in New Issue
Block a user