mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
15 lines
315 B
Nim
15 lines
315 B
Nim
# 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))
|