fix #807
This commit is contained in:
parent
9dd753f218
commit
eaab22089d
2 changed files with 7 additions and 7 deletions
|
|
@ -1324,8 +1324,8 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
|||
let (outer, inner) = insertDestructors(c, n.sons[i])
|
||||
if outer != nil:
|
||||
n.sons[i] = outer
|
||||
for j in countup(i+1, length-1):
|
||||
inner.addSon(semStmt(c, n.sons[j]))
|
||||
var rest = newNode(nkStmtList, n.info, n.sons[i+1 .. length-1])
|
||||
inner.addSon(semStmtList(c, rest, flags))
|
||||
n.sons.setLen(i+1)
|
||||
return
|
||||
of LastBlockStmts:
|
||||
|
|
|
|||
|
|
@ -80,13 +80,13 @@ proc mygeneric1() =
|
|||
echo "mygeneric1 constructed"
|
||||
|
||||
proc mygeneric2[T](val: T) =
|
||||
var
|
||||
a = open()
|
||||
b = TMyGeneric2[int, T](x: 10, y: val)
|
||||
c = TMyGeneric3[int, int, string](x: 10, y: 20, z: "test")
|
||||
|
||||
var a = open()
|
||||
|
||||
var b = TMyGeneric2[int, T](x: 10, y: val)
|
||||
echo "mygeneric2 constructed"
|
||||
|
||||
var c = TMyGeneric3[int, int, string](x: 10, y: 20, z: "test")
|
||||
|
||||
proc mygeneric3 =
|
||||
var x = TMyGeneric3[int, string, TMyGeneric1[int]](
|
||||
x: 10, y: "test", z: TMyGeneric1[int](x: 10))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue