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 {
386
386
Type getType () const {
387
387
switch (getKind ()) {
388
388
case Kind::Opaque:
389
- return getOpaqueFunction ()->getType ()->lookThroughSingleOptionalType ();
389
+ return getOpaqueFunction ()->getType ()->lookThroughAllOptionalTypes ();
390
390
case Kind::Function: {
391
391
auto *AFD = getFunction ();
392
392
if (AFD->hasImplicitSelfDecl () && AppliedSelf)
@@ -395,8 +395,7 @@ class AbstractFunction {
395
395
}
396
396
case Kind::Closure: return getClosure ()->getType ();
397
397
case Kind::Parameter:
398
- return getParameter ()->getInterfaceType ()
399
- ->lookThroughSingleOptionalType ();
398
+ return getParameter ()->getInterfaceType ()->lookThroughAllOptionalTypes ();
400
399
}
401
400
llvm_unreachable (" bad kind" );
402
401
}
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