Do not log error when casting fails

This allows not to perform unnecessary 'of' check before
casting, if cast failure is expected.
This commit is contained in:
Ruslan Mustakov 2019-12-04 23:58:13 +07:00
commit 78d3626fa3
2 changed files with 1 additions and 4 deletions

View file

@ -1,4 +1,4 @@
version = "0.7.24"
version = "0.7.25"
author = "Xored Software, Inc."
description = "Godot Engine bindings"
license = "MIT"

View file

@ -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.} =