Commit Graph

17 Commits

Author SHA1 Message Date
flywind
c80261bc00 fix #12311 (#16578) 2021-01-04 10:24:52 +01:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
Timothee Cour
6a0e87eb38 cleanup Ordinal (#13501) 2020-02-27 10:43:13 +01:00
Timothee Cour
bf22b44b1f miscellaneous bug fixes (#13291)
* fix for emscripten etc

* add testcase for #13290

* replace deprecated isNilOrWhitespace
2020-01-30 10:54:50 +01:00
Arne Döring
3d4ad9739c fix min/max for float numbers (#12068) 2019-09-02 11:21:26 +02:00
Arne Döring
d564130a3b Fix to int to biggest int (#12066)
* fix to(Biggest)Int
* kill toFloat magics as well
2019-08-27 23:18:46 +02:00
Timothee Cour
6ce3949c8a add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
2019-01-08 18:37:25 -08:00
Timothee Cour
319b46230c fix bug in doAssertRaises when exception==Exception (#10172)
* fix bug in doAssertRaises when exception==Exception
* add testcase for doAssertRaises
2019-01-04 13:54:02 +01:00
Timothee Cour
0831292863 revives: Move typetraits.$ to system. Fixes #5827 (#10071)
* Move typetraits.`$` to system. Fixes #5827.
* revive PR; adjust code to make sure everything works and add tests
* fix tests/concepts/tstackconcept.nim
* address comments
2018-12-30 01:09:47 +01:00
c-blake
1b3725e395 Add toOpenArray[T](ptr UncheckedArray[T]) for clarity. (#9316)
* Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity.  `ptr array[0,T]`
for some unchecked type already works but A) `UncheckedArray` seems to be
the intended future way for this kind of access, and B) essentially all use
cases will have a `ptr` for that kind of array source and this call signature
lets callers drop the trailing `[]` corresponding to that `ptr` deref.
This PR relates to issue https://github.com/nim-lang/Nim/issues/9001 .

* Add a test for toOpenArray() for UncheckedArray[T]s.
2018-10-12 17:40:07 +02:00
Araq
d48e964950 fixes #9281 2018-10-11 19:52:48 +02:00
Dmitry Atamanov
a6c3bbf01a Add proc toOpenArray[byte] for strings (#7820) 2018-07-07 21:03:22 +02:00
nitely
7297195f9f test negative range array 2018-06-06 02:22:33 -03:00
nitely
ba39f359aa check bounds instead of index 2018-06-05 20:22:27 -03:00
Araq
1d9343080d added toOpenArray builtin for zero-copy slices; syntax sugar yet to come 2018-03-24 20:26:34 +01:00
Andreas Rumpf
46275f6b8f fixes #6710 2017-11-08 15:45:26 +01:00
Fabian Keller
badba83d38 Implementation of high/low for SomeReal (#6570) 2017-10-30 17:21:44 +01:00