Skip to content

Commit 23b837e

Browse files
committed
fix codegen tests
1 parent 736a48d commit 23b837e

File tree

5 files changed

+165
-114
lines changed

5 files changed

+165
-114
lines changed

Samples/SwiftJavaExtractJNISampleApp/Sources/MySwiftLibrary/Async.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,3 @@ public func asyncOptional(i: Int64) async throws -> Int64? {
3636
public func asyncThrows() async throws {
3737
throw MySwiftError.swiftError
3838
}
39-
40-
public func asyncRunningSum() async -> Int64 {
41-
let totalSum = await withTaskGroup(of: Int64.self) { group in
42-
// 1. Add child tasks to the group
43-
for number in stride(from: Int64(1), through: 100, by: 1) {
44-
group.addTask {
45-
try? await Task.sleep(for: .milliseconds(number))
46-
return number
47-
}
48-
}
49-
50-
var collectedSum: Int64 = 0
51-
52-
// `for await ... in group` loops as each child task completes,
53-
// (not necessarily in the order they were added).
54-
for await number in group {
55-
collectedSum += number
56-
}
57-
58-
return collectedSum
59-
}
60-
61-
// This is the value returned by the `withTaskGroup` closure.
62-
return totalSum
63-
}

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+JavaTranslation.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,6 @@ extension JNISwift2JavaGenerator {
10961096
case .replacingPlaceholder(let inner, let placeholder):
10971097
return inner.render(&printer, placeholder)
10981098

1099-
case .return(let inner):
1100-
let inner = inner.render(&printer, placeholder)
1101-
return "return \(inner);"
1102-
11031099
case .lambda(let args, let body):
11041100
var printer = CodePrinter()
11051101
printer.printBraceBlock("(\(args.joined(separator: ", "))) ->") { printer in
@@ -1112,9 +1108,6 @@ extension JNISwift2JavaGenerator {
11121108
}
11131109
return printer.finalize()
11141110

1115-
case .null:
1116-
return "null"
1117-
11181111
case .print(let inner):
11191112
let inner = inner.render(&printer, placeholder)
11201113
printer.print("\(inner);")

Sources/SwiftJavaRuntimeSupport/DefaultCaches.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2025 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
import SwiftJava
216

317
extension _JNIMethodIDCache {

Sources/SwiftJavaRuntimeSupport/_JNIBoxedConversions.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2025 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
import CSwiftJavaJNI
216
import SwiftJava
317

0 commit comments

Comments
 (0)