Skip to content

Commit e77c715

Browse files
authored
Merge pull request #16068 from DougGregor/sr-7457
2 parents e8a1524 + 8d2ca38 commit e77c715

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@ Type TypeBase::adjustSuperclassMemberDeclType(const ValueDecl *baseDecl,
34123412
genericMemberType->getExtInfo());
34133413
}
34143414

3415-
auto type = memberType.subst(subs);
3415+
auto type = memberType.subst(subs, SubstFlags::UseErrorType);
34163416

34173417
if (isa<AbstractFunctionDecl>(baseDecl)) {
34183418
type = type->replaceSelfParameterType(this);

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5334,6 +5334,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
53345334
// Check whether the types are identical.
53355335
auto parentDeclTy = owningTy->adjustSuperclassMemberDeclType(
53365336
parentDecl, decl, parentDecl->getInterfaceType());
5337+
if (parentDeclTy->hasError()) continue;
53375338
parentDeclTy = parentDeclTy->getUnlabeledType(TC.Context);
53385339
if (method) {
53395340
// For methods, strip off the 'Self' type.

validation-test/compiler_crashers_2/0123-rdar31164540.swift renamed to validation-test/compiler_crashers_2_fixed/0123-rdar31164540.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not --crash %target-swift-frontend -parse-stdlib -DBUILDING_OUTSIDE_STDLIB %s -emit-ir
1+
// RUN: not %target-swift-frontend -parse-stdlib -DBUILDING_OUTSIDE_STDLIB %s -emit-ir
22
// REQUIRES: objc_interop
33

44
//===----------------------------------------------------------------------===//
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-swift-frontend %s -emit-ir
2+
protocol Proto { }
3+
4+
class Class {
5+
func foo<A>(callback: (A) -> Void) where A: Proto {
6+
}
7+
8+
func foo<A, B>(callback: (A, B) -> Void) where A: Proto, B: Proto {
9+
}
10+
}
11+
12+
class Child: Class {
13+
override func foo<A>(callback: (A) -> Void) where A : Proto {
14+
}
15+
}
16+

0 commit comments

Comments
 (0)