diff --git a/lib/system.nim b/lib/system.nim index d1f9107154..b8e91f668b 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -76,6 +76,10 @@ type void* {.magic: "VoidType".} ## meta type to denote the absence of any type auto* = expr any* = distinct auto + untyped* {.magic: Expr.} ## meta type to denote an expression that + ## is not resolved (for templates) + typed* {.magic: Stmt.} ## meta type to denote an expression that + ## is resolved (for templates) SomeSignedInt* = int|int8|int16|int32|int64 ## type class matching all signed integer types diff --git a/tests/template/ttempl2.nim b/tests/template/ttempl2.nim index 142bbb8c71..aaa2f13447 100644 --- a/tests/template/ttempl2.nim +++ b/tests/template/ttempl2.nim @@ -3,12 +3,12 @@ discard """ line: 18 errormsg: "undeclared identifier: \'b\'" """ -template declareInScope(x: expr, t: typeDesc): stmt {.immediate.} = +template declareInScope(x: untyped, t: typeDesc): untyped {.immediate.} = var x: t - -template declareInNewScope(x: expr, t: typeDesc): stmt {.immediate.} = + +template declareInNewScope(x: untyped, t: typeDesc): untyped {.immediate.} = # open a new scope: - block: + block: var x: t declareInScope(a, int) diff --git a/todo.txt b/todo.txt index ad36947d61..a61f932a93 100644 --- a/todo.txt +++ b/todo.txt @@ -2,8 +2,6 @@ version 0.10.4 ============== - make 'nil' work for 'add' and 'len' -- introduce typed/untyped types - version 1.0 =========== diff --git a/web/news.txt b/web/news.txt index 54867036a7..9fd7c31b35 100644 --- a/web/news.txt +++ b/web/news.txt @@ -69,6 +69,10 @@ News spacing around binary operators. Later versions of the language will parse these as unary operators instead so that ``echo $foo`` finally can do what people expect it to do. + - ``system.untyped`` and ``system.typed`` have been introduced as aliases + for ``expr`` and ``stmt``. The new names capture the semantics much better + and most likely ``expr`` and ``stmt`` will be deprecated in favor of the + new names. Language Additions