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 @@ -8695,7 +8695,7 @@ ExprWalker::rewriteTarget(SolutionApplicationTarget target) {
8695
8695
return convertType &&
8696
8696
!convertType->hasPlaceholder () &&
8697
8697
!target.isOptionalSomePatternInit () &&
8698
- !(solution.getType (resultExpr)->isUninhabited () &&
8698
+ !(solution.getResolvedType (resultExpr)->isUninhabited () &&
8699
8699
cs.getContextualTypePurpose (target.getAsExpr ())
8700
8700
== CTP_ReturnSingleExpr);
8701
8701
};
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