Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private struct FunctionSpecializations {

switch apply {
case let applyInst as ApplyInst:
let newApply = builder.createApply(function: specializedCallee, applyInst.substitutionMap, arguments: newArgs)
let newApply = builder.createApply(function: specializedCallee, applyInst.substitutionMap, arguments: newArgs, isNonThrowing: applyInst.isNonThrowing)
applyInst.replace(with: newApply, context)
case let partialAp as PartialApplyInst:
let newApply = builder.createPartialApply(function: specializedCallee, substitutionMap:
Expand Down
38 changes: 38 additions & 0 deletions validation-test/SILOptimizer/gh84337.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// RUN: %target-build-swift -O %s

@propertyWrapper
public struct Dependency2<Value> {
public init(
_ keyPath: KeyPath<DependencyValues, Value>
) {

}
public var wrappedValue: Value {
let any: Any = "somestring"
return any as! Value
}
}

struct Client {
var get: (_ id: String) -> Bool
}

public struct DependencyValues {
var client3: Client
}

public protocol WindowData2 {
var id :String {get set}
}

extension WindowData2 {
func didSetProfileForSpaceIDs(
spaceIDs: [String]
) -> Void {
@Dependency2(\.client3) var client: Client
spaceIDs.forEach { _ in
spaceIDs
.map { _ in return client.get(id) }
}
}
}