cleanup Ordinal (#13501)

This commit is contained in:
Timothee Cour 2020-02-27 01:43:13 -08:00 • committed by GitHub
commit 6a0e87eb38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 10 deletions

View file

@ -87,6 +87,18 @@ proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
## # Do here programmer friendly expensive sanity checks.
## # Put here the normal code
when defined(nimHashOrdinalFixed):
type
Ordinal*[T] {.magic: Ordinal.} ## Generic ordinal type. Includes integer,
## bool, character, and enumeration types
## as well as their subtypes. See also
## `SomeOrdinal`.
else:
# bootstrap <= 0.20.0
type
OrdinalImpl[T] {.magic: Ordinal.}
Ordinal* = OrdinalImpl | uint | uint64
when defined(nimHasRunnableExamples):
proc runnableExamples*(body: untyped) {.magic: "RunnableExamples".}
## A section you should use to mark `runnable example`:idx: code with.