summary refs log tree commit diff stats
path: root/tests/ccgbugs/t8781.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ccgbugs/t8781.nim')
-rw-r--r--tests/ccgbugs/t8781.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ccgbugs/t8781.nim b/tests/ccgbugs/t8781.nim
new file mode 100644
index 000000000..1fa8ec8a5
--- /dev/null
+++ b/tests/ccgbugs/t8781.nim
@@ -0,0 +1,25 @@
+discard """
+output: ""
+"""
+
+type
+  Drawable = object of RootObj
+    discard
+
+  # issue #8781, following type was broken due to 'U' suffix
+  # on `animatedU`. U also added as union identifier for C.
+  # replaced by "_U" prefix, which is not allowed as an
+  # identifier
+  TypeOne = ref object of Drawable
+    animatedU: bool
+    case animated: bool
+    of true:
+        frames: seq[int]
+    of false:
+        region: float
+
+when isMainModule:
+  let r = 1.5
+  let a = TypeOne(animatedU: true,
+                  animated: false,
+                  region: r)