From 78d3626fa36c5749e098fa32086c34a39a6ad81e Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Wed, 4 Dec 2019 23:58:13 +0700 Subject: [PATCH] Do not log error when casting fails This allows not to perform unnecessary 'of' check before casting, if cast failure is expected. --- godot.nimble | 2 +- godot/nim/godotnim.nim | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/godot.nimble b/godot.nimble index 6b77ece..1ad646b 100644 --- a/godot.nimble +++ b/godot.nimble @@ -1,4 +1,4 @@ -version = "0.7.24" +version = "0.7.25" author = "Xored Software, Inc." description = "Godot Engine bindings" license = "MIT" diff --git a/godot/nim/godotnim.nim b/godot/nim/godotnim.nim index cf989dc..4d577cc 100644 --- a/godot/nim/godotnim.nim +++ b/godot/nim/godotnim.nim @@ -332,9 +332,6 @@ proc `as`*[T: NimGodotObject](obj: NimGodotObject, t: typedesc[T]): T = elif not obj.linkedObject.isNil and system.`of`(obj.linkedObject, T): result = T(obj.linkedObject) else: - when not defined(release): - printError("Failed to cast object to " & - T.name & "\n" & getStackTrace()) result = nil proc `of`*[T1, T2: NimGodotObject](obj: T1, t: typedesc[T2]): bool {.inline.} =