mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
fixes symbolName for range enums (#24052)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user