mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* closed ambiguous enum defaults to first overload * add warning * turn to hint * work around config
16 lines
282 B
Nim
16 lines
282 B
Nim
import mcrossmodule
|
|
|
|
type
|
|
MyEnum = enum
|
|
Success
|
|
|
|
template t =
|
|
doAssert some(Success)
|
|
|
|
t()
|
|
|
|
block: # legacy support for behavior before overloadableEnums
|
|
# warning: ambiguous enum field 'Success' assumed to be of type MyEnum
|
|
let x = {Success}
|
|
doAssert x is set[MyEnum]
|