From 94f6f7c8a790911aa71d7034bd0bac37bdab2338 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Thu, 27 Jul 2017 11:06:26 +0700 Subject: [PATCH] Fix checking for void and table's toGodot --- godot.nimble | 2 +- godot/nim/godotmacros.nim | 3 ++- godot/nim/godotnim.nim | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/godot.nimble b/godot.nimble index eecbb2f..371275f 100644 --- a/godot.nimble +++ b/godot.nimble @@ -1,4 +1,4 @@ -version = "0.2.3" +version = "0.2.4" author = "Xored Software, Inc." description = "Godot Engine bindings" license = "MIT" diff --git a/godot/nim/godotmacros.nim b/godot/nim/godotmacros.nim index 4ab140c..3e32176 100644 --- a/godot/nim/godotmacros.nim +++ b/godot/nim/godotmacros.nim @@ -473,7 +473,8 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} = else: toGodotStyle(meth.name) let hasReturnValueBool = not (meth.returnType.isNil or meth.returnType.kind == nnkEmpty or - $meth.returnType == "void") + (meth.returnType.kind == nnkIdent and + meth.returnType.ident == !"void")) let hasReturnValue = if hasReturnValueBool: ident("true") else: ident("false") result.add(getAst( diff --git a/godot/nim/godotnim.nim b/godot/nim/godotnim.nim index a36ee91..e998ee8 100644 --- a/godot/nim/godotnim.nim +++ b/godot/nim/godotnim.nim @@ -493,7 +493,7 @@ proc godotVariantType*(T: typedesc[Table|TableRef]): VariantType {.inline.} = VariantType.Dictionary proc toGodot*[T: Table or TableRef](t: T): Variant = - let dict = initDictionary() + var dict = initDictionary() mixin toGodot for k, v in t.pairs(): dict[toGodot(k)] = toGodot(v)