diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-04-17 02:14:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 11:14:09 +0200 |
commit | 7e94420847d2d18347410099e97195ddebe8b85f (patch) | |
tree | 667576cbc4d9f7adea5162a256856222b983c6b4 /lib/core | |
parent | 8e474fbb57c2f7b58a840b5b30230c2267633c8e (diff) | |
download | Nim-7e94420847d2d18347410099e97195ddebe8b85f.tar.gz |
cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744)
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/typeinfo.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim index 08d567351..d66dc1898 100644 --- a/lib/core/typeinfo.nim +++ b/lib/core/typeinfo.nim @@ -322,12 +322,12 @@ proc base*(x: Any): Any = proc isNil*(x: Any): bool = ## `isNil` for an `x` that represents a cstring, proc or ## some pointer type. - assert x.rawType.kind in {tyCString, tyRef, tyPtr, tyPointer, tyProc} + assert x.rawType.kind in {tyCstring, tyRef, tyPtr, tyPointer, tyProc} result = isNil(cast[ppointer](x.value)[]) const pointerLike = - when defined(gcDestructors): {tyCString, tyRef, tyPtr, tyPointer, tyProc} - else: {tyString, tyCString, tyRef, tyPtr, tyPointer, tySequence, tyProc} + when defined(gcDestructors): {tyCstring, tyRef, tyPtr, tyPointer, tyProc} + else: {tyString, tyCstring, tyRef, tyPtr, tyPointer, tySequence, tyProc} proc getPointer*(x: Any): pointer = ## Retrieves the pointer value out of `x`. `x` needs to be of kind @@ -669,7 +669,7 @@ proc setString*(x: Any, y: string) = proc getCString*(x: Any): cstring = ## Retrieves the `cstring` value out of `x`. `x` needs to represent a `cstring`. - assert x.rawType.kind == tyCString + assert x.rawType.kind == tyCstring result = cast[ptr cstring](x.value)[] proc assign*(x, y: Any) = |