fixes #8781 by appending "_U" instead of 'U' (#8787)

This commit is contained in:
Vindaar 2018-08-27 08:35:07 +02:00 • committed by Andreas Rumpf
commit 52f03fabc1
2 changed files with 28 additions and 1 deletions

25
tests/ccgbugs/t8781.nim Normal file
View file

@ -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)