diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/strscans.nim | 4 | ||||
-rw-r--r-- | lib/system.nim | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/pure/strscans.nim b/lib/pure/strscans.nim index 734317e67..77763ff43 100644 --- a/lib/pure/strscans.nim +++ b/lib/pure/strscans.nim @@ -317,8 +317,8 @@ macro scanf*(input: string; pattern: static[string]; results: varargs[typed]): b template at(s: string; i: int): char = (if i < s.len: s[i] else: '\0') template matchError() = - error("type mismatch between pattern '$" & pattern[p] & "' (position: " & $p & ") and " & repr(getType(results[i])) & - " var '" & repr(results[i]) & "'") + error("type mismatch between pattern '$" & pattern[p] & "' (position: " & $p & + ") and " & $getTypeInst(results[i]) & " var '" & repr(results[i]) & "'") var i = 0 var p = 0 diff --git a/lib/system.nim b/lib/system.nim index 353500a4a..49e6a396d 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2332,6 +2332,16 @@ proc `==`*[I, T](x, y: array[I, T]): bool = return result = true +proc `==`*[T](x, y: openarray[T]): bool = + if x.len != y.len: + return false + + for f in low(x)..high(x): + if x[f] != y[f]: + return false + + result = true + proc `@`*[T](a: openArray[T]): seq[T] = ## turns an openarray into a sequence. This is not as efficient as turning ## a fixed length array into a sequence as it always copies every element |