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) {
86958695 return convertType &&
86968696 !convertType->hasPlaceholder () &&
86978697 !target.isOptionalSomePatternInit () &&
8698- !(solution.getType (resultExpr)->isUninhabited () &&
8698+ !(solution.getResolvedType (resultExpr)->isUninhabited () &&
86998699 cs.getContextualTypePurpose (target.getAsExpr ())
87008700 == CTP_ReturnSingleExpr);
87018701 };
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