Skip to content

Commit 5aa9f53

Browse files
committed
typecheck
1 parent e786544 commit 5aa9f53

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
21372137

21382138
// Check redeclaration.
21392139
(void)evaluateOrDefault(
2140-
Context.evaluator,
2140+
Ctx.evaluator,
21412141
CheckRedeclarationRequest{
21422142
VD, VD->getDeclContext()->getSelfNominalTypeDecl()},
21432143
{});
@@ -2164,11 +2164,11 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
21642164
// expressions to mean something builtin to the language. We *do* allow
21652165
// these if they are escaped with backticks though.
21662166
if (VD->getDeclContext()->isTypeContext() &&
2167-
(VD->getName().isSimpleName(Context.Id_Type) ||
2168-
VD->getName().isSimpleName(Context.Id_Protocol)) &&
2167+
(VD->getName().isSimpleName(Ctx.Id_Type) ||
2168+
VD->getName().isSimpleName(Ctx.Id_Protocol)) &&
21692169
VD->getNameLoc().isValid() &&
2170-
Context.SourceMgr.extractText({VD->getNameLoc(), 1}) != "`") {
2171-
auto &DE = Context.Diags;
2170+
Ctx.SourceMgr.extractText({VD->getNameLoc(), 1}) != "`") {
2171+
auto &DE = Ctx.Diags;
21722172
DE.diagnose(VD->getNameLoc(), diag::reserved_member_name,
21732173
VD, VD->getBaseIdentifier().str());
21742174
DE.diagnose(VD->getNameLoc(), diag::backticks_to_escape)
@@ -2212,27 +2212,25 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
22122212
// target was loaded for the main module, where both belong to the same package;
22132213
// this is an expected behavior, but it should have been loaded from the local
22142214
// build directory, not from distributed SDK. In such case, we show a warning.
2215-
auto &diags = ID->Ctx.Diags;
2216-
diags.diagnose(ID,
2217-
diag::in_package_module_not_compiled_locally,
2218-
target->getBaseIdentifier(),
2219-
target->getPackageName(),
2220-
target->getModuleFilename());
2215+
Ctx.Diags.diagnose(ID,
2216+
diag::in_package_module_not_compiled_locally,
2217+
target->getBaseIdentifier(),
2218+
target->getPackageName(),
2219+
target->getModuleFilename());
22212220
}
22222221

22232222
// Report the public import of a private module.
2224-
if (ID->Ctx.LangOpts.LibraryLevel == LibraryLevel::API) {
2223+
if (Ctx.LangOpts.LibraryLevel == LibraryLevel::API) {
22252224
auto importer = ID->getModuleContext();
22262225
if (target &&
22272226
!ID->getAttrs().hasAttribute<ImplementationOnlyAttr>() &&
22282227
!ID->getAttrs().hasAttribute<SPIOnlyAttr>() &&
22292228
ID->getAccessLevel() == AccessLevel::Public &&
22302229
target->getLibraryLevel() == LibraryLevel::SPI) {
22312230

2232-
auto &diags = ID->Ctx.Diags;
22332231
InFlightDiagnostic inFlight =
2234-
diags.diagnose(ID, diag::error_public_import_of_private_module,
2235-
target->getName(), importer->getName());
2232+
Ctx.Diags.diagnose(ID, diag::error_public_import_of_private_module,
2233+
target->getName(), importer->getName());
22362234
if (ID->getAttrs().isEmpty()) {
22372235
inFlight.fixItInsert(ID->getStartLoc(),
22382236
"@_implementationOnly ");
@@ -2500,7 +2498,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
25002498
if (Ctx.LangOpts.hasFeature(Feature::StaticExclusiveOnly) &&
25012499
SD->getAttrs().hasAttribute<StaticExclusiveOnlyAttr>() &&
25022500
!VD->isLet()) {
2503-
SD->Ctx.Diags.diagnoseWithNotes(
2501+
Ctx.Diags.diagnoseWithNotes(
25042502
VD->diagnose(diag::attr_static_exclusive_only_let_only,
25052503
VD->getInterfaceType()),
25062504
[&]() {

0 commit comments

Comments
 (0)