From 6a0e87eb387c13f1d6f78e1736c23cdb4a06b504 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 27 Feb 2020 01:43:13 -0800 Subject: cleanup Ordinal (#13501) --- lib/system/arithmetics.nim | 4 ++-- lib/system/basic_types.nim | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/system') diff --git a/lib/system/arithmetics.nim b/lib/system/arithmetics.nim index ba9ade192..757a813e8 100644 --- a/lib/system/arithmetics.nim +++ b/lib/system/arithmetics.nim @@ -22,7 +22,7 @@ proc pred*[T: Ordinal](x: T, y = 1): T {.magic: "Pred", noSideEffect.} ## echo pred(5) # => 4 ## echo pred(5, 3) # => 2 -proc inc*[T: Ordinal|uint|uint64](x: var T, y = 1) {.magic: "Inc", noSideEffect.} +proc inc*[T: Ordinal](x: var T, y = 1) {.magic: "Inc", noSideEffect.} ## Increments the ordinal ``x`` by ``y``. ## ## If such a value does not exist, ``OverflowError`` is raised or a compile @@ -33,7 +33,7 @@ proc inc*[T: Ordinal|uint|uint64](x: var T, y = 1) {.magic: "Inc", noSideEffect. ## inc(i) # i <- 3 ## inc(i, 3) # i <- 6 -proc dec*[T: Ordinal|uint|uint64](x: var T, y = 1) {.magic: "Dec", noSideEffect.} +proc dec*[T: Ordinal](x: var T, y = 1) {.magic: "Dec", noSideEffect.} ## Decrements the ordinal ``x`` by ``y``. ## ## If such a value does not exist, ``OverflowError`` is raised or a compile diff --git a/lib/system/basic_types.nim b/lib/system/basic_types.nim index 39ad0a76c..a6bf69ebc 100644 --- a/lib/system/basic_types.nim +++ b/lib/system/basic_types.nim @@ -20,10 +20,6 @@ const off* = false ## Alias for ``false``. type - Ordinal*[T] {.magic: Ordinal.} ## Generic ordinal type. Includes integer, - ## bool, character, and enumeration types - ## as well as their subtypes. - SomeSignedInt* = int|int8|int16|int32|int64 ## Type class matching all signed integer types. @@ -35,7 +31,7 @@ type SomeOrdinal* = int|int8|int16|int32|int64|bool|enum|uint|uint8|uint16|uint32|uint64 ## Type class matching all ordinal types; however this includes enums with - ## holes. + ## holes. See also `Ordinal` BiggestInt* = int64 ## is an alias for the biggest signed integer type the Nim compiler -- cgit 1.4.1-2-gfad0