mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
* document general use of `_`, error message, fixes fixes #20687, fixes #21435 Documentation and changelog updated to clarify new universal behavior of `_`. Also new error message for attempting to use `_`, new tests, and fixes with overloadable symbols and implicit generics. * add test for #21435
16 lines
270 B
Nim
16 lines
270 B
Nim
import std/assertions
|
|
|
|
block:
|
|
proc _() = echo "one"
|
|
doAssert not compiles(_())
|
|
proc _() = echo "two"
|
|
doAssert not compiles(_())
|
|
|
|
block:
|
|
type _ = int
|
|
doAssert not (compiles do:
|
|
let x: _ = 3)
|
|
type _ = float
|
|
doAssert not (compiles do:
|
|
let x: _ = 3)
|