mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-26 08:31:44 +00:00
11
tests/enum/tbasicenum.nim
Normal file
11
tests/enum/tbasicenum.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
discard """
|
||||
file: "tbasicenum.nim"
|
||||
output: "ABCDC"
|
||||
"""
|
||||
|
||||
type
|
||||
MyEnum = enum
|
||||
A,B,C,D
|
||||
# trick the optimizer with an seq:
|
||||
var x = @[A,B,C,D]
|
||||
echo x[0],x[1],x[2],x[3],MyEnum(2)
|
||||
Reference in New Issue
Block a user