parent
cb21fd4f8f
commit
12f22ba68a
4 changed files with 9 additions and 6 deletions
|
|
@ -124,6 +124,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
||||||
if n.sons[paramsPos].kind != nkEmpty:
|
if n.sons[paramsPos].kind != nkEmpty:
|
||||||
removeDefaultParamValues(n.sons[ParamsPos])
|
removeDefaultParamValues(n.sons[ParamsPos])
|
||||||
semParamList(c, n.sons[ParamsPos], nil, result)
|
semParamList(c, n.sons[ParamsPos], nil, result)
|
||||||
|
#echo "generated this return type: ", renderTree(n.sons[ParamsPos])
|
||||||
addParams(c, result.typ.n)
|
addParams(c, result.typ.n)
|
||||||
else:
|
else:
|
||||||
result.typ = newTypeS(tyProc, c)
|
result.typ = newTypeS(tyProc, c)
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,8 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
|
||||||
assert(f != nil)
|
assert(f != nil)
|
||||||
assert(a != nil)
|
assert(a != nil)
|
||||||
if a.kind == tyGenericInst and
|
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))
|
return typeRel(mapping, f, lastSon(a))
|
||||||
if a.kind == tyVar and f.kind != tyVar:
|
if a.kind == tyVar and f.kind != tyVar:
|
||||||
return typeRel(mapping, f, a.sons[0])
|
return typeRel(mapping, f, a.sons[0])
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,12 @@ proc on*(emitter: var TEventEmitter, event: string, func: proc(e: TEventArgs)) =
|
||||||
#append(emitter.events[event], func)
|
#append(emitter.events[event], func)
|
||||||
#adds the function to the event's list. I get a error here too.
|
#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)]]()
|
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.on("print", proc(e: TEventArgs) = echo("pie"))
|
||||||
ee.emit("print")
|
ee.emit("print", args)
|
||||||
|
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -1,7 +1,6 @@
|
||||||
Version 0.8.14
|
Version 0.8.14
|
||||||
==============
|
==============
|
||||||
|
|
||||||
- fix serious bug that keeps teventemitter from compiling
|
|
||||||
- ``var T`` as a return type: add ``modGet`` for generics
|
- ``var T`` as a return type: add ``modGet`` for generics
|
||||||
- optional indentation for 'case' statement
|
- optional indentation for 'case' statement
|
||||||
- make threadvar efficient again on linux after testing
|
- make threadvar efficient again on linux after testing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue