mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
intVal works now on enum field symbols (#11403)
* intVal works now on enum field symbols * disable flakey titerators test
This commit is contained in:
committed by
Andreas Rumpf
parent
9230862534
commit
efbf43d4a9
@@ -1,7 +1,10 @@
|
||||
discard """
|
||||
target: "c"
|
||||
disabled: true
|
||||
"""
|
||||
|
||||
# Timers are always flakey on the testing servers.
|
||||
|
||||
import coro
|
||||
include system/timers
|
||||
|
||||
|
||||
@@ -93,3 +93,14 @@ static:
|
||||
quit("may not be evaluated")
|
||||
|
||||
assert( (myLit or bottom()) == myLit )
|
||||
|
||||
type
|
||||
Fruit = enum
|
||||
apple
|
||||
banana
|
||||
orange
|
||||
|
||||
macro foo(x: typed) =
|
||||
doAssert Fruit(x.intVal) == banana
|
||||
|
||||
foo(banana)
|
||||
|
||||
Reference in New Issue
Block a user