File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -8802,7 +8802,7 @@ ExprWalker::rewriteTarget(SolutionApplicationTarget target) {
8802
8802
return convertType &&
8803
8803
!convertType->hasPlaceholder () &&
8804
8804
!target.isOptionalSomePatternInit () &&
8805
- !(solution.getType (resultExpr)->isUninhabited () &&
8805
+ !(solution.getResolvedType (resultExpr)->isUninhabited () &&
8806
8806
cs.getContextualTypePurpose (target.getAsExpr ())
8807
8807
== CTP_ReturnSingleExpr);
8808
8808
};
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ struct S {
4
+ func crash( ) -> Never {
5
+ fatalError ( " " )
6
+ }
7
+ }
8
+
9
+ class A {
10
+ func value( ) -> Int { 42 }
11
+ }
12
+
13
+ class B : A {
14
+ let value : S = S ( )
15
+
16
+ func test( ) throws -> B {
17
+ value. crash ( ) // Ok
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments