fixes symbolName for range enums (#24052)

This commit is contained in:
ringabout
2024-09-03 22:35:04 +08:00
committed by GitHub
parent 4bf323d6c4
commit c948ab9b85
2 changed files with 17 additions and 1 deletions

View File

@@ -35,5 +35,15 @@ template main =
doAssert $b == "kb0"
static: doAssert B.high.symbolName == "b2"
block:
type
Color = enum
Red = "red", Yellow = "yellow", Blue = "blue"
var s = Red
doAssert symbolName(s) == "Red"
var x: range[Red..Blue] = Yellow
doAssert symbolName(x) == "Yellow"
static: main()
main()