mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
22 lines
328 B
V
22 lines
328 B
V
enum MyEnum {
|
|
something
|
|
another
|
|
third
|
|
}
|
|
|
|
type MyEnumAlias = MyEnum
|
|
|
|
fn test_enum_aliases() {
|
|
x := MyEnum.something
|
|
dump(x)
|
|
a := MyEnumAlias.something
|
|
dump(a)
|
|
assert x == a
|
|
//
|
|
dump(MyEnum.third)
|
|
dump(MyEnumAlias.third)
|
|
dump(int(MyEnum.third))
|
|
dump(int(MyEnumAlias.third))
|
|
assert MyEnum.third == MyEnumAlias.third
|
|
}
|