From a71c5f98ea92c4c9f96ffe9265600f9cc2b7a8ee Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 18 Sep 2012 00:36:48 +0200 Subject: [PATCH] made tests green again --- compiler/semexprs.nim | 2 +- compiler/semgnrc.nim | 17 ++++++++++++----- lib/pure/algorithm.nim | 2 +- lib/system.nim | 8 ++++---- tests/reject/tenummix.nim | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index ae9cf26d68..3c630eeec8 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1427,7 +1427,7 @@ proc buildCall(n: PNode): PNode = elif n.kind in nkCallKinds and n.sons[0].kind == nkDotExpr: # x.y(a) -> y(x, a) let a = n.sons[0] - result = newNodeI(nkDotCall, n.info, n.len+1) + result = newNodeI(nkCall, n.info, n.len+1) result.sons[0] = a.sons[1] result.sons[1] = a.sons[0] for i in 1 .. = len(x) or a[result] != key: result = -1 + if result >= len(a) or a[result] != key: result = -1 proc smartBinarySearch*[T](a: openArray[T], key: T): int = ## ``a.len`` must be a power of 2 for this to work. diff --git a/lib/system.nim b/lib/system.nim index a60433e57c..575c6abc77 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -1673,6 +1673,10 @@ template newException*(exceptn: typeDesc, message: string): expr = e.msg = message e +proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo".} + ## get type information for `x`. Ordinary code should not use this, but + ## the `typeinfo` module instead. + when not defined(EcmaScript) and not defined(NimrodVM): {.push stack_trace: off, profiler:off.} @@ -2201,10 +2205,6 @@ proc `[]=`*[T](s: var seq[T], x: TSlice[int], b: openArray[T]) = for i in 0 ..