diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 64914cb251..d3650f984d 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -367,6 +367,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode = result = newIntNode(nkIntLit, ord(t.kind == tyProc and t.callConv == ccClosure and tfIterator notin t.flags)) + else: discard else: var t2 = n[2].typ.skipTypes({tyTypeDesc}) maybeLiftType(t2, c, n.info) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 6972e3f1c6..76ac23e0d0 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -255,6 +255,7 @@ proc evalIs(n, a: PNode): PNode = result = newIntNode(nkIntLit, ord(t.kind == tyProc and t.callConv == ccClosure and tfIterator in t.flags)) + else: discard else: # XXX semexprs.isOpImpl is slightly different and requires a context. yay. let t2 = n[2].typ diff --git a/compiler/types.nim b/compiler/types.nim index 5ef2d627bd..55ec971d91 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1208,8 +1208,9 @@ proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt = else: result = ptrSize a = ptrSize of tyNil, tyCString, tyString, tySequence, tyPtr, tyRef, tyVar, tyOpenArray, - tyBigNum: - result = ptrSize + tyBigNum: + if typ.lastSon == typ: result = szIllegalRecursion + else: result = ptrSize a = result of tyArray, tyArrayConstr: let elemSize = computeSizeAux(typ.sons[1], a) diff --git a/todo.txt b/todo.txt index 2a6a74dae9..e06b3d030f 100644 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,10 @@ version 0.10 ============ - Test nimfix on various babel packages + +- bug: 'type T = ref T' not recognized as illegal recursion - deprecate recursive tuples; tuple needs laxer type checking + - VM: Pegs do not work at compile-time - VM: ptr/ref T cannot work in general @@ -44,7 +47,6 @@ Bugs ==== - scopes are still broken for generic instantiation! -- bug: 'type T = ref T' not recognized as illegal recursion - bug: type conversions concerning proc types are weird - compilation of niminst takes way too long. looks like a regression - docgen: sometimes effects are listed twice diff --git a/web/news.txt b/web/news.txt index 7edd7c9dfe..cf24139f70 100644 --- a/web/news.txt +++ b/web/news.txt @@ -49,6 +49,7 @@ News be used instead. - String case (or any non-ordinal case) statements without 'else' are deprecated. + - Recursive tuple types are deprecated. Use ``object`` instead. Language Additions