IDE: Fire
Version: Version 10.0.0.2400 (develop) built on talax, 20190503-102703. Commit dc2f219.
Target (If relevant): Android
Description:
I am getting a runtime error in Android when using java.lang.Object[] cannot be cast to uk.innerfuse.androidapplication.TreeNode[]
when using my (beloved) Result
-enum. I am not sure why I am getting this error as I am not using Object[]
as far as I know.
The code appears to fail at:
public static func fetchItems(completion: (Result<LocationNodeList>) -> ()) {
completion(.success([]))
}
when I am trying to get the actual value out of my Result
-enum using the dematerialize
-method which does the following when using the following Result definition: Result<LocationNodeList>
public func dematerialize() throws -> Value {
switch self {
case let .success(value):
return value
case let .failure(error):
throw error
}
}
I have also tried the alternative were I am returning let items = LocationNodeList()
instead of just []
but then I am getting the same error. When using the items
I am using the line: completion(.success(items))
Expected Behavior:
I would be able to execute the code included in the reproducible project without runtime errors
Actual Behavior:
I am getting a runtime cast error when running my code.
Steps:
Please find a reproducible project attached
BugReport5.zip (255.6 KB)