Sema: Call setValidationStarted() on various synthesized FuncDecls

This commit is contained in:
Slava Pestov
2018-03-21 22:29:51 -07:00
parent 9488ef3d3d
commit a8602f8eb8
6 changed files with 10 additions and 0 deletions

View File

@@ -1397,6 +1397,7 @@ void TypeChecker::completePropertyBehaviorParameter(VarDecl *VD,
Parameter->setInterfaceType(SubstInterfaceTy);
Parameter->setGenericEnvironment(genericEnv);
Parameter->setValidationStarted();
// Mark the method to be final, implicit, and private. In a class, this
// prevents it from being dynamically dispatched.

View File

@@ -768,6 +768,7 @@ static FuncDecl *deriveEncodable_encode(TypeChecker &tc, Decl *parentDecl,
}
encodeDecl->setInterfaceType(interfaceType);
encodeDecl->setValidationStarted();
encodeDecl->setAccess(target->getFormalAccess());
// If the type was not imported, the derived conformance is either from the
@@ -1109,6 +1110,7 @@ static ValueDecl *deriveDecodable_init(TypeChecker &tc, Decl *parentDecl,
}
initDecl->setInterfaceType(interfaceType);
initDecl->setValidationStarted();
initDecl->setInitializerInterfaceType(initializerType);
initDecl->setAccess(target->getFormalAccess());

View File

@@ -181,6 +181,7 @@ static ValueDecl *deriveInitDecl(TypeChecker &tc, Decl *parentDecl,
initDecl->setInterfaceType(allocIfaceType);
initDecl->setInitializerInterfaceType(initIfaceType);
initDecl->setAccess(enumDecl->getFormalAccess());
initDecl->setValidationStarted();
// If the enum was not imported, the derived conformance is either from the
// enum itself or an extension, in which case we will emit the declaration

View File

@@ -671,6 +671,7 @@ deriveEquatable_eq(TypeChecker &tc, Decl *parentDecl, NominalTypeDecl *typeDecl,
}
eqDecl->setInterfaceType(interfaceTy);
eqDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
eqDecl->setValidationStarted();
// If the enum was not imported, the derived conformance is either from the
// enum itself or an extension, in which case we will emit the declaration
@@ -1062,6 +1063,7 @@ deriveHashable_hashValue(TypeChecker &tc, Decl *parentDecl,
AnyFunctionType::ExtInfo());
getterDecl->setInterfaceType(interfaceType);
getterDecl->setValidationStarted();
getterDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
// If the enum was not imported, the derived conformance is either from the
@@ -1073,6 +1075,7 @@ deriveHashable_hashValue(TypeChecker &tc, Decl *parentDecl,
// Finish creating the property.
hashValueDecl->setImplicit();
hashValueDecl->setInterfaceType(intType);
hashValueDecl->setValidationStarted();
hashValueDecl->makeComputed(SourceLoc(), getterDecl,
nullptr, nullptr, SourceLoc());
hashValueDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);

View File

@@ -344,6 +344,7 @@ static ConstructorDecl *deriveRawRepresentable_init(TypeChecker &tc,
initDecl->setInterfaceType(allocIfaceType);
initDecl->setInitializerInterfaceType(initIfaceType);
initDecl->copyFormalAccessAndVersionedAttrFrom(enumDecl);
initDecl->setValidationStarted();
// If the enum was not imported, the derived conformance is either from the
// enum itself or an extension, in which case we will emit the declaration

View File

@@ -281,6 +281,7 @@ DerivedConformance::declareDerivedPropertyGetter(TypeChecker &tc,
FunctionType::ExtInfo());
getterDecl->setInterfaceType(interfaceType);
getterDecl->copyFormalAccessAndVersionedAttrFrom(property);
getterDecl->setValidationStarted();
// If the enum was not imported, the derived conformance is either from the
// enum itself or an extension, in which case we will emit the declaration
@@ -308,6 +309,7 @@ DerivedConformance::declareDerivedProperty(TypeChecker &tc, Decl *parentDecl,
propDecl->setImplicit();
propDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
propDecl->setInterfaceType(propertyInterfaceType);
propDecl->setValidationStarted();
// If this is supposed to be a final property, mark it as such.
assert(isFinal || !parentDC->getAsClassOrClassExtensionContext());