diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/collections/sets.nim | 2 | ||||
-rw-r--r-- | lib/system.nim | 4 | ||||
-rw-r--r-- | lib/system/embedded.nim | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 4a5471417..92ef3152d 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -130,7 +130,7 @@ proc mget*[A](s: var HashSet[A], key: A): var A = ## for sharing. assert s.isValid, "The set needs to be initialized." var index = rawGet(s, key) - if index >= 0: result = t.data[index].key + if index >= 0: result = s.data[index].key else: raise newException(KeyError, "key not found: " & $key) proc contains*[A](s: HashSet[A], key: A): bool = diff --git a/lib/system.nim b/lib/system.nim index 082b3ad40..2ad5e6af9 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -874,13 +874,13 @@ proc contains*[T](s: Slice[T], value: T): bool {.noSideEffect, inline.} = ## assert((1..3).contains(4) == false) result = s.a <= value and value <= s.b -template `in` * (x, y: expr): expr {.immediate.} = contains(y, x) +template `in` * (x, y: expr): expr {.immediate, dirty.} = contains(y, x) ## Sugar for contains ## ## .. code-block:: Nim ## assert(1 in (1..3) == true) ## assert(5 in (1..3) == false) -template `notin` * (x, y: expr): expr {.immediate.} = not contains(y, x) +template `notin` * (x, y: expr): expr {.immediate, dirty.} = not contains(y, x) ## Sugar for not containing ## ## .. code-block:: Nim diff --git a/lib/system/embedded.nim b/lib/system/embedded.nim index c6db9bca4..9bb25b8dd 100644 --- a/lib/system/embedded.nim +++ b/lib/system/embedded.nim @@ -21,7 +21,7 @@ proc popFrame {.compilerRtl, inl.} = discard proc setFrame(s: PFrame) {.compilerRtl, inl.} = discard proc pushSafePoint(s: PSafePoint) {.compilerRtl, inl.} = discard proc popSafePoint {.compilerRtl, inl.} = discard -proc pushCurrentException(e: ref E_Base) {.compilerRtl, inl.} = discard +proc pushCurrentException(e: ref Exception) {.compilerRtl, inl.} = discard proc popCurrentException {.compilerRtl, inl.} = discard # some platforms have native support for stack traces: @@ -32,7 +32,7 @@ const proc quitOrDebug() {.inline.} = quit(1) -proc raiseException(e: ref E_Base, ename: CString) {.compilerRtl.} = +proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} = sysFatal(ENoExceptionToReraise, "exception handling is not available") proc reraiseException() {.compilerRtl.} = |