mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-19 01:18:32 +00:00
avoid re-exporting options from std/wrapnils (#18222)
This commit is contained in:
@@ -25,7 +25,6 @@ runnableExamples:
|
||||
assert (?.f2.x2.x2).x3 == nil # this terminates ?. early
|
||||
|
||||
from options import Option, isSome, get, option, unsafeGet, UnpackDefect
|
||||
export options.get, options.isSome, options.isNone
|
||||
|
||||
template fakeDot*(a: Option, b): untyped =
|
||||
## See top-level example.
|
||||
@@ -90,6 +89,7 @@ macro `?.`*(a: untyped): auto =
|
||||
macro `??.`*(a: untyped): Option =
|
||||
## Same as `?.` but returns an `Option`.
|
||||
runnableExamples:
|
||||
import std/options
|
||||
type Foo = ref object
|
||||
x1: ref int
|
||||
x2: int
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import std/wrapnils
|
||||
from std/options import get, isSome
|
||||
|
||||
proc checkNotZero(x: float): float =
|
||||
doAssert x != 0
|
||||
|
||||
Reference in New Issue
Block a user