diff options
author | Jake Leahy <jake@leahy.dev> | 2023-02-21 22:27:12 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 12:27:12 +0100 |
commit | 0a45543cc1e8a2e8db59eaed864cd908726bf48d (patch) | |
tree | bf2e4c6750930786732f8dbcd48515059d948ee3 /compiler/sigmatch.nim | |
parent | de65b380edb0fe256054e217a1e6e64a6bb97527 (diff) | |
download | Nim-0a45543cc1e8a2e8db59eaed864cd908726bf48d.tar.gz |
Specify that address is taken when converter takes a var parameter (#21391)
* 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
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r-- | compiler/sigmatch.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 0dbd5e5f1..f8c7fa870 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1980,6 +1980,7 @@ proc userConvMatch(c: PContext, m: var TCandidate, f, a: PType, param = implicitConv(nkHiddenSubConv, src, copyTree(arg), m, c) elif src.kind in {tyVar}: # Analyse the converter return type + arg.sym.flags.incl sfAddrTaken param = newNodeIT(nkHiddenAddr, arg.info, s.typ[1]) param.add copyTree(arg) else: |