Hey guys,
What the difference between the first and the second assignment above. The
first one doesnt compile because it complains about:
^
/Volumes/Store/Dropbox/GameDev/UnrealProjects/NimForUEDemo/Plugins/NimForUE/.nimcache/nimforue/@mnimforue@[email protected]:2147:3:
error: no matching function for call to
'softObjectPropertyeq___nimforueZtestZtestuobject_999'
softObjectPropertyeq___nimforueZtestZtestuobject_999(obj,
TSoftObjectPtr<TY__T1k2KAFYAbKanafhstB2NQ>(expectedValue));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Store/Dropbox/GameDev/UnrealProjects/NimForUEDemo/Plugins/NimForUE/.nimcache/nimforue/@mnimforue@[email protected]:2114:31:
note: candidate function not viable: no known conversion from
'TSoftObjectPtr<TY__T1k2KAFYAbKanafhstB2NQ>' to 'TSoftObjectPtr<UObject>' for
2nd argument
N_LIB_PRIVATE N_NIMCALL(void,
softObjectPropertyeq___nimforueZtestZtestuobject_999)(tyObject_UMyClassToTest__fWkLQgqFo2ihM52CPwvqww*
obj, TY__C9c89aJGfnXV4kKxc9cZy9au4A valX60gensym53_) {
^
/Volumes/Store/Dropbox/GameDev/UnrealProjects/NimForUEDemo/Plugins/NimForUE/NimHeaders/nimbase.h:257:44:
note: expanded from macro 'N_NIMCALL'
# define N_NIMCALL(rettype, name) rettype name /* no modifier */
Run
Notice, it's generating a TSoftObjectPtr<TSoftObjectPtr<UObject>> instead of
TSoftObjectPtr<UObject> like in the second assignment.
let expectedValue = newUObject[UMyClassToTest]()
obj.softObjectProperty = makeTSoftObject(expectedValue)
let soft = makeTSoftObject(expectedValue)
obj.softObjectProperty = soft
Run
Here is the definition for TSoftObjectPtr
type TSoftObjectPtr*[out T : UObject] {.importcpp:"TSoftObjectPtr<'0>".} =
object
proc makeTSoftObject*[T : UObject](obj : ptr T) : TSoftObjectPtr[T]
{.importcpp:"TSoftObjectPtr<'0>(#)" constructor.}
Run
Thanks,
Juan