summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-03-05 07:39:52 +0100
committerAraq <rumpf_a@web.de>2013-03-05 07:39:52 +0100
commit16821e31bec05053017233c743f2b46e5c4c414b (patch)
treef41236f44fa7f9749b72574f6d38f971e707af05
parent1fcc704f4affd052256b5abb46c62452fcca09f5 (diff)
downloadNim-16821e31bec05053017233c743f2b46e5c4c414b.tar.gz
bugfix: tvtable works again
-rwxr-xr-xcompiler/semexprs.nim7
-rwxr-xr-xtests/run/tvtable.nim2
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index fe2a3f811..e1cdfcc35 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -620,8 +620,9 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
   let nOrig = n.copyTree
   semOpAux(c, n)
   var t: PType = nil
-  if (n.sons[0].typ != nil): t = skipTypes(n.sons[0].typ, abstractInst)
-  if (t != nil) and (t.kind == tyProc):
+  if n.sons[0].typ != nil:
+    t = skipTypes(n.sons[0].typ, abstractInst-{tyTypedesc})
+  if t != nil and t.kind == tyProc:
     # This is a proc variable, apply normal overload resolution
     var m: TCandidate
     initCandidate(m, t)
@@ -653,7 +654,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
     # we assume that a procedure that calls something indirectly 
     # has side-effects:
     if tfNoSideEffect notin t.flags: incl(c.p.owner.flags, sfSideEffect)
-  elif (t != nil) and t.kind == tyTypeDesc:
+  elif t != nil and t.kind == tyTypeDesc:
     let destType = t.skipTypes({tyTypeDesc, tyGenericInst})
     result = semConv(c, n, symFromType(destType, n.info))
     return 
diff --git a/tests/run/tvtable.nim b/tests/run/tvtable.nim
index 36b67277a..51894618c 100755
--- a/tests/run/tvtable.nim
+++ b/tests/run/tvtable.nim
@@ -15,7 +15,7 @@ type
   barProc[T] = proc (o: var T)
 
   # an untyped table to store the proc pointers
-  # it's also possible to use a strontly typed tuple here
+  # it's also possible to use a strongly typed tuple here
   VTable = array[0..1, pointer]
   
   TBase = object {.inheritable.}