mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
* better error messages for dot operators [backport] fixes #13063 * also fixes #7777 * fix #6981 and #9831 too * fix * minor improvement * sus test fixes * make test multiplatform lol * fix nimsuggest test, extra improvements
23 lines
410 B
Nim
23 lines
410 B
Nim
# issue #6981
|
|
|
|
import std/assertions
|
|
|
|
{.experimental: "callOperator".}
|
|
|
|
block: # issue #6981
|
|
proc `()`(a:string, b:string):string = a & b
|
|
|
|
var s = newSeq[int](3)
|
|
|
|
doAssert s == @[0, 0, 0]
|
|
|
|
block: # generalized example from #6981
|
|
proc mewSeq[T](a: int)=discard
|
|
proc mewSeq[T]()= discard
|
|
mewSeq[int]()
|
|
|
|
block: # issue #9831
|
|
type Foo = object
|
|
proc `()`(foo: Foo) = discard
|
|
let x = newSeq[int]()
|