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
5 changes: 2 additions & 3 deletions lib/Sema/TypeCheckEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class AbstractFunction {
Type getType() const {
switch (getKind()) {
case Kind::Opaque:
return getOpaqueFunction()->getType()->lookThroughSingleOptionalType();
return getOpaqueFunction()->getType()->lookThroughAllOptionalTypes();
case Kind::Function: {
auto *AFD = getFunction();
if (AFD->hasImplicitSelfDecl() && AppliedSelf)
Expand All @@ -395,8 +395,7 @@ class AbstractFunction {
}
case Kind::Closure: return getClosure()->getType();
case Kind::Parameter:
return getParameter()->getInterfaceType()
->lookThroughSingleOptionalType();
return getParameter()->getInterfaceType()->lookThroughAllOptionalTypes();
}
llvm_unreachable("bad kind");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %target-typecheck-verify-swift

@propertyWrapper
struct Weak<Value> {
var wrappedValue: Value? { fatalError() }
}

struct WeakStorage<Item: Hashable> {
@Weak var action: ((Set<Item>) -> Void)??
}

final class Test {
var storage: WeakStorage<AnyHashable> = .init()

func test(items: Set<AnyHashable>) {
storage.action??(items)
}
}