diff options
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", |