Skip to content

Commit 14477a7

Browse files
authored
Merge pull request swiftlang#27480 from brentdax/absence-of-results
Fix StringInterpolationProtocol validation crasher
2 parents a4fcd26 + 6456b39 commit 14477a7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6999,11 +6999,8 @@ StaticSpellingKind FuncDecl::getCorrectStaticSpelling() const {
69996999
}
70007000

70017001
Type FuncDecl::getResultInterfaceType() const {
7002-
if (!hasInterfaceType())
7003-
return nullptr;
7004-
70057002
Type resultTy = getInterfaceType();
7006-
if (resultTy->is<ErrorType>())
7003+
if (resultTy.isNull() || resultTy->is<ErrorType>())
70077004
return resultTy;
70087005

70097006
if (hasImplicitSelfDecl())
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: not %target-swift-frontend -typecheck %s %S/Inputs/0208-rdar55864759-protocol.swift
2+
struct StringInterpolation: MagicStringInterpolationProtocol {}
3+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
protocol MagicStringInterpolationProtocol: StringInterpolationProtocol {}
2+
3+
extension MagicStringInterpolationProtocol {
4+
mutating func appendInterpolation<Value>(_ value: Value) {}
5+
}
6+

0 commit comments

Comments
 (0)