File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ class AbstractFunction {
386386 Type getType () const {
387387 switch (getKind ()) {
388388 case Kind::Opaque:
389- return getOpaqueFunction ()->getType ()->lookThroughSingleOptionalType ();
389+ return getOpaqueFunction ()->getType ()->lookThroughAllOptionalTypes ();
390390 case Kind::Function: {
391391 auto *AFD = getFunction ();
392392 if (AFD->hasImplicitSelfDecl () && AppliedSelf)
@@ -395,8 +395,7 @@ class AbstractFunction {
395395 }
396396 case Kind::Closure: return getClosure ()->getType ();
397397 case Kind::Parameter:
398- return getParameter ()->getInterfaceType ()
399- ->lookThroughSingleOptionalType ();
398+ return getParameter ()->getInterfaceType ()->lookThroughAllOptionalTypes ();
400399 }
401400 llvm_unreachable (" bad kind" );
402401 }
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift
2+
3+ @propertyWrapper
4+ struct Weak < Value> {
5+ var wrappedValue : Value ? { fatalError ( ) }
6+ }
7+
8+ struct WeakStorage < Item: Hashable > {
9+ @Weak var action : ( ( Set < Item > ) -> Void ) ? ?
10+ }
11+
12+ final class Test {
13+ var storage : WeakStorage < AnyHashable > = . init( )
14+
15+ func test( items: Set < AnyHashable > ) {
16+ storage. action?? ( items)
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments