mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
fixes #24905 fixes #24903 fixes https://github.com/nim-lang/Nim/issues/11805 fixes https://github.com/nim-lang/Nim/issues/15650 In the first phase of generic checking, we cannot warn/error symbols because they can belong a false branch of `when` or there is a `push/pop` options using open symbols. So we cannot decide whether to warn/error or not
40 lines
644 B
Nim
40 lines
644 B
Nim
discard """
|
|
matrix: "--warningAsError:Deprecated"
|
|
"""
|
|
|
|
block: # bug #24905
|
|
proc y() {.deprecated.} = discard
|
|
proc v(_: int | int) =
|
|
{.push warning[Deprecated]: off.}
|
|
y()
|
|
{.pop.}
|
|
|
|
v(1)
|
|
|
|
block: # bug #24903
|
|
block:
|
|
proc y() {.deprecated.} = discard
|
|
proc m(_: int | int) =
|
|
when false: y()
|
|
|
|
block:
|
|
proc y() {.error.} = discard
|
|
proc m(_: int | int) =
|
|
when false: y()
|
|
|
|
block:
|
|
proc y() {.error.} = discard
|
|
proc m(_: int | int) =
|
|
when true: y()
|
|
|
|
block: # bug #15650
|
|
proc bar() {.deprecated.} = discard
|
|
|
|
template foo() =
|
|
when false:
|
|
bar()
|
|
else:
|
|
discard
|
|
|
|
foo()
|