Skip to content

Commit 6373a5d

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. (cherry picked from commit 91724c9)
1 parent 8227182 commit 6373a5d

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.
@@ -3142,7 +3142,7 @@ namespace {
31423142
if (DRE->getDecl() != Context.TheBuiltinModule)
31433143
return false;
31443144

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

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,8 +2029,7 @@ class FallbackDiagnosticListener : public ExprTypeCheckListener {
20292029
[](const std::pair<ConstraintLocator *, ProtocolConformanceRef>
20302030
&conformance) -> bool {
20312031
auto &ref = conformance.second;
2032-
return ref.isConcrete() && (ref.getConcrete()->isInvalid() ||
2033-
ref.getConcrete()->isIncomplete());
2032+
return ref.isConcrete() && ref.getConcrete()->isInvalid();
20342033
}))
20352034
return;
20362035

0 commit comments

Comments
 (0)