Skip to content

Commit d7d4ba3

Browse files
Merge pull request #84378 from nate-chandler/rdar160742150
[AllocBoxToStack] Fix missing [nothrow] of apply.
2 parents cf3dab1 + 30098ad commit d7d4ba3

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AllocBoxToStack.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private struct FunctionSpecializations {
261261

262262
switch apply {
263263
case let applyInst as ApplyInst:
264-
let newApply = builder.createApply(function: specializedCallee, applyInst.substitutionMap, arguments: newArgs)
264+
let newApply = builder.createApply(function: specializedCallee, applyInst.substitutionMap, arguments: newArgs, isNonThrowing: applyInst.isNonThrowing)
265265
applyInst.replace(with: newApply, context)
266266
case let partialAp as PartialApplyInst:
267267
let newApply = builder.createPartialApply(function: specializedCallee, substitutionMap:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// RUN: %target-build-swift -O %s
2+
3+
@propertyWrapper
4+
public struct Dependency2<Value> {
5+
public init(
6+
_ keyPath: KeyPath<DependencyValues, Value>
7+
) {
8+
9+
}
10+
public var wrappedValue: Value {
11+
let any: Any = "somestring"
12+
return any as! Value
13+
}
14+
}
15+
16+
struct Client {
17+
var get: (_ id: String) -> Bool
18+
}
19+
20+
public struct DependencyValues {
21+
var client3: Client
22+
}
23+
24+
public protocol WindowData2 {
25+
var id :String {get set}
26+
}
27+
28+
extension WindowData2 {
29+
func didSetProfileForSpaceIDs(
30+
spaceIDs: [String]
31+
) -> Void {
32+
@Dependency2(\.client3) var client: Client
33+
spaceIDs.forEach { _ in
34+
spaceIDs
35+
.map { _ in return client.get(id) }
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)