Skip to content

Commit

Permalink
adds a test case (#24464)
Browse files Browse the repository at this point in the history
closes #7784
  • Loading branch information
ringabout authored Nov 21, 2024
1 parent b7b1003 commit 3eddb64
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/ccgbugs/tsamename3.nim
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,24 @@ block: # issue #22571
foo:
type Foo = object
doAssert $Foo() == "()"

block: # bug #7784
block:
type
Color = enum clrBlack, clrRed, clrGreen, clrBlue

var color = clrRed
doAssert(ord(color) == 1)
doAssert($color == "clrRed")

block:
type
Color = enum
clrBlack = "Black",
clrRed = "Red",
clrGreen = "Green",
clrBlue = "Blue"

var color = clrRed
doAssert(ord(color) == 1)
doAssert($color == "Red")

0 comments on commit 3eddb64

Please sign in to comment.