summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-04-22 20:25:11 +0200
committerAraq <rumpf_a@web.de>2015-04-22 20:25:11 +0200
commitbcd8053b2309ab33240cf73c280f73699c59ea1d (patch)
treedd739508b4ef6a13ea178fe61e42723142ff31b3 /compiler
parent13c5f792dce81c89e0578c7aa296928ada6b9eb4 (diff)
downloadNim-bcd8053b2309ab33240cf73c280f73699c59ea1d.tar.gz
fixes #2585
Diffstat (limited to 'compiler')
-rw-r--r--compiler/parampatterns.nim2
-rw-r--r--compiler/semdata.nim10
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim
index 3f67005b9..55b4bf213 100644
--- a/compiler/parampatterns.nim
+++ b/compiler/parampatterns.nim
@@ -184,7 +184,7 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult =
   case n.kind
   of nkSym:
     # don't list 'skLet' here:
-    if n.sym.kind in {skVar, skResult, skTemp}:
+    if n.sym.kind in {skVar, skResult, skTemp, skParam}:
       if owner != nil and owner.id == n.sym.owner.id and
           sfGlobal notin n.sym.flags:
         result = arLocalLValue
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 1c2720006..345a8c0d1 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -118,7 +118,6 @@ proc newOptionEntry*(): POptionEntry
 proc newLib*(kind: TLibKind): PLib
 proc addToLib*(lib: PLib, sym: PSym)
 proc makePtrType*(c: PContext, baseType: PType): PType
-proc makeVarType*(c: PContext, baseType: PType): PType
 proc newTypeS*(kind: TTypeKind, c: PContext): PType
 proc fillTypeS*(dest: PType, kind: TTypeKind, c: PContext)
 
@@ -213,9 +212,12 @@ proc makePtrType(c: PContext, baseType: PType): PType =
   result = newTypeS(tyPtr, c)
   addSonSkipIntLit(result, baseType.assertNotNil)
 
-proc makeVarType(c: PContext, baseType: PType): PType =
-  result = newTypeS(tyVar, c)
-  addSonSkipIntLit(result, baseType.assertNotNil)
+proc makeVarType*(c: PContext, baseType: PType): PType =
+  if baseType.kind == tyVar:
+    result = baseType
+  else:
+    result = newTypeS(tyVar, c)
+    addSonSkipIntLit(result, baseType.assertNotNil)
 
 proc makeTypeDesc*(c: PContext, typ: PType): PType =
   result = newTypeS(tyTypeDesc, c)