From 4616a1e006f0b909d204d8e8f1ad3cd43d8db556 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 4 Oct 2014 14:23:17 +0200 Subject: updated some tests --- compiler/semstmts.nim | 2 +- doc/manual/locking.txt | 6 ++++-- tests/typerel/trectuple.nim | 4 ++++ tests/typerel/trectuples.nim | 4 ++++ todo.txt | 3 +-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 063df30fd..255507548 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -268,7 +268,7 @@ proc semTry(c: PContext, n: PNode): PNode = checkMinSonsLen(a, 1) var length = sonsLen(a) if a.kind == nkExceptBranch: - # XXX what does this do? so that ``except [a, b, c]`` is supported? + # so that ``except [a, b, c]`` is supported: if length == 2 and a.sons[0].kind == nkBracket: a.sons[0..0] = a.sons[0].sons length = a.sonsLen diff --git a/doc/manual/locking.txt b/doc/manual/locking.txt index b646f0cee..1a6d2783c 100644 --- a/doc/manual/locking.txt +++ b/doc/manual/locking.txt @@ -19,7 +19,7 @@ Guards and the locks section Protecting global variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Global variables and object fields can be annotated via an ``guard`` pragma: +Object fields and global variables can be annotated via a ``guard`` pragma: .. code-block:: nim var glock: TLock @@ -161,7 +161,9 @@ single ``locks`` section: ... -So here is how a typical multilock statement can be implemented in Nim: +Here is how a typical multilock statement can be implemented in Nim. Note how +the runtime check is required to ensure a global ordering for two locks ``a`` +and ``b`` of the same lock level: .. code-block:: nim template multilock(a, b: ptr TLock; body: stmt) = diff --git a/tests/typerel/trectuple.nim b/tests/typerel/trectuple.nim index 7c43ec5ba..ebaaa2ea7 100644 --- a/tests/typerel/trectuple.nim +++ b/tests/typerel/trectuple.nim @@ -1,3 +1,7 @@ +discard """ + errormsg: "illegal recursion in type 'TNode'" + line: 8 +""" type PNode = ref TNode diff --git a/tests/typerel/trectuples.nim b/tests/typerel/trectuples.nim index c59cfe880..a74e4859c 100644 --- a/tests/typerel/trectuples.nim +++ b/tests/typerel/trectuples.nim @@ -1,3 +1,7 @@ +discard """ + errormsg: "illegal recursion in type 'Node'" + line: 6 +""" type Node = tuple[left: ref Node] diff --git a/todo.txt b/todo.txt index 7790a9c8a..1e01793de 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,7 @@ version 0.10 ============ +- fix the bug that keeps 'defer' template from working - Test nimfix on various babel packages @@ -27,7 +28,6 @@ Low priority: Misc ---- -- fix the bug that keeps 'defer' template from working - make '--implicitStatic:on' the default - make tuple unpacking work in a non-var/let context - special rule for ``[]=``, items, pairs @@ -62,7 +62,6 @@ version 0.9.x - memory manager: add a measure of fragmentation - implement 'bits' pragmas - we need a magic thisModule symbol -- provide --nilChecks:on|off - ensure (ref T)(a, b) works as a type conversion and type constructor - optimize 'genericReset'; 'newException' leads to code bloat -- cgit 1.4.1-2-gfad0