summary refs log tree commit diff stats
path: root/compiler/dfa.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2022-09-01 19:10:00 +0300
committerGitHub <noreply@github.com>2022-09-01 18:10:00 +0200
commita95b6391fd353074daf2dbfed4d73e8d57f314ca (patch)
tree74b60b45b1f58010b3cadda3becf1bc79eb01cbd /compiler/dfa.nim
parent1f838d9af1a80580d08815ad6a11a8e7b2945c80 (diff)
downloadNim-a95b6391fd353074daf2dbfed4d73e8d57f314ca.tar.gz
support cstring in `case` (#20130)
* implement case for cstring

for now just converts to string on C backend

* custom implementation for cstring

* remove leftover

* revert even more

* add nil + fix packages weird variant literal bug

* update docs
Diffstat (limited to 'compiler/dfa.nim')
-rw-r--r--compiler/dfa.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/dfa.nim b/compiler/dfa.nim
index 5b048ff6e..669207151 100644
--- a/compiler/dfa.nim
+++ b/compiler/dfa.nim
@@ -461,7 +461,7 @@ proc genCase(c: var Con; n: PNode) =
   #    elsePart
   #  Lend:
   let isExhaustive = skipTypes(n[0].typ,
-    abstractVarRange-{tyTypeDesc}).kind notin {tyFloat..tyFloat128, tyString}
+    abstractVarRange-{tyTypeDesc}).kind notin {tyFloat..tyFloat128, tyString, tyCstring}
 
   # we generate endings as a set of chained gotos, this is a bit awkward but it
   # ensures when recursively traversing the CFG for various analysis, we don't