mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 13:04:44 +00:00
delay markUsed for converters until call is resolved (#24243)
fixes #24241
(cherry picked from commit 09043f409f)
This commit is contained in:
14
tests/converter/tdeprecatedconverter.nim
Normal file
14
tests/converter/tdeprecatedconverter.nim
Normal file
@@ -0,0 +1,14 @@
|
||||
# issue #24241
|
||||
|
||||
{.warningAsError[Deprecated]: on.}
|
||||
|
||||
type X = distinct int
|
||||
|
||||
converter toInt(x: X): int{.deprecated.} = int(x)
|
||||
|
||||
template `==`(a, b: X): bool = false # this gets called so we didn't convert
|
||||
|
||||
doAssert not (X(1) == X(2))
|
||||
doAssert not compiles(X(1) + X(2))
|
||||
doAssert not (compiles do:
|
||||
let x: int = X(1))
|
||||
Reference in New Issue
Block a user