summary refs log tree commit diff stats
path: root/compiler/ccgutils.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ccgutils.nim')
-rw-r--r--compiler/ccgutils.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim
index d9aa58c67..ea4f3fe18 100644
--- a/compiler/ccgutils.nim
+++ b/compiler/ccgutils.nim
@@ -122,8 +122,10 @@ proc ccgIntroducedPtr*(conf: ConfigRef; s: PSym, retType: PType): bool =
   var pt = skipTypes(s.typ, typedescInst)
   assert skResult != s.kind
   
+  #note precedence: params override types
   if optByRef in s.options: return true
-  if tfByRef in pt.flags: return true
+  elif sfByCopy in s.flags: return false 
+  elif tfByRef in pt.flags: return true
   elif tfByCopy in pt.flags: return false
   case pt.kind
   of tyObject: