diff options
author | cooldome <ariabushenko@gmail.com> | 2020-11-20 13:58:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-20 14:58:16 +0100 |
commit | fcb2ec4ed69fe924e7e3899e0084f534124255d4 (patch) | |
tree | 27f848f60dfe7e2a93f69362419e78b93e0c2a00 /compiler | |
parent | 07ad608fb2a9387fefc61a8eef9e0777660516a9 (diff) | |
download | Nim-fcb2ec4ed69fe924e7e3899e0084f534124255d4.tar.gz |
fix #15958 (#15970) [backport:1.4]
* fix #15958 * also cover openArray and VarArgs * more tests * cover even more types * cover even more types * Trigger build * Trigger build * cover sets passed as arrays
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgtypes.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index e3f832d68..142fec056 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -282,7 +282,8 @@ proc ccgIntroducedPtr(conf: ConfigRef; s: PSym, retType: PType): bool = result = false # first parameter and return type is 'lent T'? --> use pass by pointer if s.position == 0 and retType != nil and retType.kind == tyLent: - result = pt.kind != tyVar + result = not (pt.kind in {tyVar, tyArray, tyOpenArray, tyVarargs, tyRef, tyPtr, tyPointer} or + pt.kind == tySet and mapSetType(conf, pt) == ctArray) proc fillResult(conf: ConfigRef; param: PNode) = fillLoc(param.sym.loc, locParam, param, ~"Result", |