diff options
author | Zahary Karadjov <zahary@gmail.com> | 2017-04-28 17:07:54 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2017-04-28 17:07:54 +0300 |
commit | bc01835091df93d8d278a55c62338e96be646e46 (patch) | |
tree | c1ba8add6ba97953e15346b0369f068324175e02 /lib | |
parent | 3e52bb6535a70339cf4a15123be09916ef0c31f6 (diff) | |
download | Nim-bc01835091df93d8d278a55c62338e96be646e46.tar.gz |
Allow tyOr,tyAnd and tyNot to be constructed in more contexts
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 82d3bb7f7..f9ae5b552 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -49,6 +49,9 @@ type cstring* {.magic: Cstring.} ## built-in cstring (*compatible string*) type pointer* {.magic: Pointer.} ## built-in pointer type, use the ``addr`` ## operator to get a pointer to a variable + + typedesc* {.magic: TypeDesc.} ## meta type to denote a type description + const on* = true ## alias for ``true`` off* = false ## alias for ``false`` @@ -56,6 +59,18 @@ const {.push warning[GcMem]: off, warning[Uninit]: off.} {.push hints: off.} +proc `|` *(a, b: typedesc): typedesc {.magic: "TypeTrait", noSideEffect.} + ## Constructs an `or` meta class + +proc `or` *(a, b: typedesc): typedesc {.magic: "TypeTrait", noSideEffect.} + ## Constructs an `or` meta class + +proc `and` *(a, b: typedesc): typedesc {.magic: "TypeTrait", noSideEffect.} + ## Constructs an `and` meta class + +proc `not` *(a: typedesc): typedesc {.magic: "TypeTrait", noSideEffect.} + ## Constructs an `not` meta class + type Ordinal* {.magic: Ordinal.}[T] ## Generic ordinal type. Includes integer, ## bool, character, and enumeration types @@ -66,11 +81,11 @@ type `ref`* {.magic: Pointer.}[T] ## built-in generic traced pointer type `nil` {.magic: "Nil".} + expr* {.magic: Expr, deprecated.} ## meta type to denote an expression (for templates) - ## **Deprecated** since version 0.15. Use ``untyped`` instead. + ## **Deprecated** since version 0.15. Use ``untyped`` instead. stmt* {.magic: Stmt, deprecated.} ## meta type to denote a statement (for templates) ## **Deprecated** since version 0.15. Use ``typed`` instead. - typedesc* {.magic: TypeDesc.} ## meta type to denote a type description void* {.magic: "VoidType".} ## meta type to denote the absence of any type auto* {.magic: Expr.} ## meta type for automatic type determination any* = distinct auto ## meta type for any supported type |