summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-08-08 01:15:09 +0200
committerAraq <rumpf_a@web.de>2011-08-08 01:15:09 +0200
commit12f22ba68a4c12042f2e72febdda32ff84b63307 (patch)
treee80870ae2e3f18ec86c0526186c0a16fb7604732
parentcb21fd4f8f0255099da15da53e304b1ea12f05f3 (diff)
downloadNim-12f22ba68a4c12042f2e72febdda32ff84b63307.tar.gz
fixes #35, fixes #43
-rwxr-xr-xcompiler/seminst.nim3
-rwxr-xr-xcompiler/sigmatch.nim3
-rw-r--r--tests/accept/run/teventemitter.nim8
-rwxr-xr-xtodo.txt1
4 files changed, 9 insertions, 6 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim
index 87f988ed9..9feac18d2 100755
--- a/compiler/seminst.nim
+++ b/compiler/seminst.nim
@@ -121,9 +121,10 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
   instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry)
   n.sons[genericParamsPos] = ast.emptyNode
   # semantic checking for the parameters:
-  if n.sons[paramsPos].kind != nkEmpty: 
+  if n.sons[paramsPos].kind != nkEmpty:
     removeDefaultParamValues(n.sons[ParamsPos])
     semParamList(c, n.sons[ParamsPos], nil, result)
+    #echo "generated this return type: ", renderTree(n.sons[ParamsPos])
     addParams(c, result.typ.n)
   else: 
     result.typ = newTypeS(tyProc, c)
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index ea40dd0c9..ecf6a32c4 100755
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -231,7 +231,8 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
   assert(f != nil)
   assert(a != nil)
   if a.kind == tyGenericInst and
-      skipTypes(f, {tyVar}).kind notin {tyGenericBody, tyGenericInvokation}: 
+      skipTypes(f, {tyVar}).kind notin {
+        tyGenericBody, tyGenericInvokation, tyGenericParam}: 
     return typeRel(mapping, f, lastSon(a))
   if a.kind == tyVar and f.kind != tyVar: 
     return typeRel(mapping, f, a.sons[0])
diff --git a/tests/accept/run/teventemitter.nim b/tests/accept/run/teventemitter.nim
index 68970b967..1fa2f2a25 100644
--- a/tests/accept/run/teventemitter.nim
+++ b/tests/accept/run/teventemitter.nim
@@ -17,10 +17,12 @@ proc on*(emitter: var TEventEmitter, event: string, func: proc(e: TEventArgs)) =
   #append(emitter.events[event], func)
   #adds the function to the event's list. I get a error here too.
 
-proc initEmitter(emitter: TEventEmitter) =
+proc initEmitter(emitter: var TEventEmitter) =
   emitter.events = initTable[string, TDoublyLinkedList[proc(e: TEventArgs)]]()
 
-var ee: TEventEmitter
+var 
+  ee: TEventEmitter
+  args: TEventArgs
 ee.on("print", proc(e: TEventArgs) = echo("pie"))
-ee.emit("print")
+ee.emit("print", args)
 
diff --git a/todo.txt b/todo.txt
index 56bc80a6b..cb6f9e74d 100755
--- a/todo.txt
+++ b/todo.txt
@@ -1,7 +1,6 @@
 Version 0.8.14
 ==============
 
-- fix serious bug that keeps teventemitter from compiling
 - ``var T`` as a return type: add ``modGet`` for generics
 - optional indentation for 'case' statement
 - make threadvar efficient again on linux after testing