mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
This is in reference to a [feature request](https://github.com/nim-lang/Nim/issues/22142) that I posted. I'm making this PR to demonstrate the suggested change and expect that this should be scrutinized --------- Co-authored-by: Bung <crc32@qq.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
17 lines
350 B
Nim
17 lines
350 B
Nim
discard """
|
|
errormsg: "ambiguous call"
|
|
"""
|
|
|
|
#[
|
|
As of the time of writing `object` needs some special
|
|
treament in order to be considered "generic" in the right
|
|
context when used implicitly
|
|
]#
|
|
|
|
type
|
|
C = object
|
|
|
|
proc test[T: object](param: T): bool = false
|
|
proc test(param: object): bool = true
|
|
doAssert test(C()) == true # previously would pass
|