mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 10:24:44 +00:00
expr => untyped; stmt => typed (#14804)
* expr => untyped; stmt => typed * changelog + comment
This commit is contained in:
@@ -221,6 +221,7 @@ proc mydiv(a, b): int {.raises: [].} =
|
||||
See [docgen](docgen.html#introduction-quick-start) for details.
|
||||
- Removed the `--oldNewlines` switch.
|
||||
- Removed the `--laxStrings` switch for mutating the internal zero terminator on strings.
|
||||
- `$getType(untyped)` is now "untyped" instead of "expr", `$getType(typed)` is now "typed" instead of "stmt"
|
||||
|
||||
|
||||
## Tool changes
|
||||
|
||||
@@ -93,8 +93,8 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
|
||||
of tyBool: result = atomicType("bool", mBool)
|
||||
of tyChar: result = atomicType("char", mChar)
|
||||
of tyNil: result = atomicType("nil", mNil)
|
||||
of tyUntyped: result = atomicType("expr", mExpr)
|
||||
of tyTyped: result = atomicType("stmt", mStmt)
|
||||
of tyUntyped: result = atomicType("untyped", mExpr)
|
||||
of tyTyped: result = atomicType("typed", mStmt)
|
||||
of tyVoid: result = atomicType("void", mVoid)
|
||||
of tyEmpty: result = atomicType("empty", mNone)
|
||||
of tyUncheckedArray:
|
||||
|
||||
@@ -49,6 +49,12 @@ block: # typeToString
|
||||
doAssert (tuple[a: C2b[MyInt, C4[cstring]], b: cint, c: float]).name3 ==
|
||||
"tuple[a: C[MyInt{int}, C4[cstring]], b: cint{int32}, c: float]"
|
||||
|
||||
macro fn(): string =
|
||||
# not 100% sure whether this should even compile; if some PR breaks this test,
|
||||
# this could be revisited, maybe.
|
||||
newLit $($getType(untyped), $getType(typed))
|
||||
doAssert fn() == """("untyped", "typed")"""
|
||||
|
||||
block distinctBase:
|
||||
block:
|
||||
type
|
||||
|
||||
Reference in New Issue
Block a user