mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 02:42:05 +00:00
* Add test case * closes #21247 Add the sfAddrTaken flag to var parameters in converters This allows the JS backend to properly pass the parameter as a fat pointer
16 lines
494 B
Nim
16 lines
494 B
Nim
import std/typetraits
|
|
|
|
type
|
|
QueryParams* = distinct seq[(string, string)]
|
|
|
|
converter toBase*(params: var QueryParams): var seq[(string, string)] =
|
|
params.distinctBase
|
|
|
|
proc foo(): QueryParams =
|
|
# Issue was that the implicit converter call didn't say that it took the
|
|
# address of the parameter it was converting. This led to the parameter not being
|
|
# passed as a fat pointer which toBase expected
|
|
result.add(("hello", "world"))
|
|
|
|
assert foo().distinctBase() == @[("hello", "world")]
|