Skip to content

Commit 91724c9

Browse files
committed
[TypeChecker] Address review comments
* Incomplete conformance is not necessarily going to produce a diagnostic * Use `userFacingName` to avoid assert related to special names.
1 parent 64fa0ee commit 91724c9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/Sema/CSGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ namespace {
15821582
// If this is `Builtin.trigger_fallback_diagnostic()`, fail
15831583
// without producing any diagnostics, in order to test fallback error.
15841584
if (isTriggerFallbackDiagnosticBuiltin(expr, CS.getASTContext()))
1585-
return nullptr;
1585+
return Type();
15861586

15871587
// Open a member constraint for constructor delegations on the
15881588
// subexpr type.
@@ -3143,7 +3143,7 @@ namespace {
31433143
if (DRE->getDecl() != Context.TheBuiltinModule)
31443144
return false;
31453145

3146-
auto member = UDE->getName().getBaseIdentifier().str();
3146+
auto member = UDE->getName().getBaseName().userFacingName();
31473147
return member.equals("trigger_fallback_diagnostic");
31483148
}
31493149

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,8 +2006,7 @@ class FallbackDiagnosticListener : public ExprTypeCheckListener {
20062006
[](const std::pair<ConstraintLocator *, ProtocolConformanceRef>
20072007
&conformance) -> bool {
20082008
auto &ref = conformance.second;
2009-
return ref.isConcrete() && (ref.getConcrete()->isInvalid() ||
2010-
ref.getConcrete()->isIncomplete());
2009+
return ref.isConcrete() && ref.getConcrete()->isInvalid();
20112010
}))
20122011
return;
20132012

0 commit comments

Comments
 (0)