Skip to content

Commit da66a1a

Browse files
committed
82532: Unexpected cast error: java.lang.Object[] cannot be cast to uk.innerfuse.androidapplication.TreeNode[]
1 parent e55b9c1 commit da66a1a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Source/Array.Java.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ public extension Swift.Array : java.util.List<T> {
99
public func contains(_ arg1: Object!) -> Bool {
1010
return list.contains(arg1)
1111
}
12+
@inline(__always)
1213
public func toArray<T>(_ arg1: T![]) -> T![] {
13-
return list.toArray<T>(arg1)
14+
return platformList.toArray<T>(arg1)
1415
}
16+
@inline(__always)
1517
public func toArray() -> Object![] {
16-
return list.toArray()
18+
return platformList.toArray()
1719
}
1820
mutating func add(_ arg1: Int32, _ arg2: T!) {
1921
makeUnique()

Source/Array.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public struct Array<T>
9292
public init(repeating value: T, count: Int) {
9393
if count == 0 {
9494
list = PlatformList<T>()
95-
} else {
95+
} else{
9696
#if JAVA
9797
list = PlatformList<T>(count)
9898
for i in 0 ..< count {
@@ -181,10 +181,12 @@ public struct Array<T>
181181
public static func __implicit(_ array: T[]) -> [T] {
182182
return [T](arrayLiteral: array)
183183
}
184-
184+
// In Coope
185+
#if !COOPER
185186
public static func __implicit(_ array: [T]) -> T[] {
186187
return array.nativeArray
187188
}
189+
#endif
188190

189191
// Cast from/to platform type
190192

0 commit comments

Comments
 (0)