mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Call setValidationStarted() on various synthesized FuncDecls
This commit is contained in:
@@ -1397,6 +1397,7 @@ void TypeChecker::completePropertyBehaviorParameter(VarDecl *VD,
|
|||||||
|
|
||||||
Parameter->setInterfaceType(SubstInterfaceTy);
|
Parameter->setInterfaceType(SubstInterfaceTy);
|
||||||
Parameter->setGenericEnvironment(genericEnv);
|
Parameter->setGenericEnvironment(genericEnv);
|
||||||
|
Parameter->setValidationStarted();
|
||||||
|
|
||||||
// Mark the method to be final, implicit, and private. In a class, this
|
// Mark the method to be final, implicit, and private. In a class, this
|
||||||
// prevents it from being dynamically dispatched.
|
// prevents it from being dynamically dispatched.
|
||||||
|
|||||||
@@ -768,6 +768,7 @@ static FuncDecl *deriveEncodable_encode(TypeChecker &tc, Decl *parentDecl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
encodeDecl->setInterfaceType(interfaceType);
|
encodeDecl->setInterfaceType(interfaceType);
|
||||||
|
encodeDecl->setValidationStarted();
|
||||||
encodeDecl->setAccess(target->getFormalAccess());
|
encodeDecl->setAccess(target->getFormalAccess());
|
||||||
|
|
||||||
// If the type was not imported, the derived conformance is either from the
|
// 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->setInterfaceType(interfaceType);
|
||||||
|
initDecl->setValidationStarted();
|
||||||
initDecl->setInitializerInterfaceType(initializerType);
|
initDecl->setInitializerInterfaceType(initializerType);
|
||||||
initDecl->setAccess(target->getFormalAccess());
|
initDecl->setAccess(target->getFormalAccess());
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ static ValueDecl *deriveInitDecl(TypeChecker &tc, Decl *parentDecl,
|
|||||||
initDecl->setInterfaceType(allocIfaceType);
|
initDecl->setInterfaceType(allocIfaceType);
|
||||||
initDecl->setInitializerInterfaceType(initIfaceType);
|
initDecl->setInitializerInterfaceType(initIfaceType);
|
||||||
initDecl->setAccess(enumDecl->getFormalAccess());
|
initDecl->setAccess(enumDecl->getFormalAccess());
|
||||||
|
initDecl->setValidationStarted();
|
||||||
|
|
||||||
// If the enum was not imported, the derived conformance is either from the
|
// 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
|
// enum itself or an extension, in which case we will emit the declaration
|
||||||
|
|||||||
@@ -671,6 +671,7 @@ deriveEquatable_eq(TypeChecker &tc, Decl *parentDecl, NominalTypeDecl *typeDecl,
|
|||||||
}
|
}
|
||||||
eqDecl->setInterfaceType(interfaceTy);
|
eqDecl->setInterfaceType(interfaceTy);
|
||||||
eqDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
eqDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
||||||
|
eqDecl->setValidationStarted();
|
||||||
|
|
||||||
// If the enum was not imported, the derived conformance is either from the
|
// 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
|
// 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());
|
AnyFunctionType::ExtInfo());
|
||||||
|
|
||||||
getterDecl->setInterfaceType(interfaceType);
|
getterDecl->setInterfaceType(interfaceType);
|
||||||
|
getterDecl->setValidationStarted();
|
||||||
getterDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
getterDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
||||||
|
|
||||||
// If the enum was not imported, the derived conformance is either from the
|
// 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.
|
// Finish creating the property.
|
||||||
hashValueDecl->setImplicit();
|
hashValueDecl->setImplicit();
|
||||||
hashValueDecl->setInterfaceType(intType);
|
hashValueDecl->setInterfaceType(intType);
|
||||||
|
hashValueDecl->setValidationStarted();
|
||||||
hashValueDecl->makeComputed(SourceLoc(), getterDecl,
|
hashValueDecl->makeComputed(SourceLoc(), getterDecl,
|
||||||
nullptr, nullptr, SourceLoc());
|
nullptr, nullptr, SourceLoc());
|
||||||
hashValueDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
hashValueDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
||||||
|
|||||||
@@ -344,6 +344,7 @@ static ConstructorDecl *deriveRawRepresentable_init(TypeChecker &tc,
|
|||||||
initDecl->setInterfaceType(allocIfaceType);
|
initDecl->setInterfaceType(allocIfaceType);
|
||||||
initDecl->setInitializerInterfaceType(initIfaceType);
|
initDecl->setInitializerInterfaceType(initIfaceType);
|
||||||
initDecl->copyFormalAccessAndVersionedAttrFrom(enumDecl);
|
initDecl->copyFormalAccessAndVersionedAttrFrom(enumDecl);
|
||||||
|
initDecl->setValidationStarted();
|
||||||
|
|
||||||
// If the enum was not imported, the derived conformance is either from the
|
// 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
|
// enum itself or an extension, in which case we will emit the declaration
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ DerivedConformance::declareDerivedPropertyGetter(TypeChecker &tc,
|
|||||||
FunctionType::ExtInfo());
|
FunctionType::ExtInfo());
|
||||||
getterDecl->setInterfaceType(interfaceType);
|
getterDecl->setInterfaceType(interfaceType);
|
||||||
getterDecl->copyFormalAccessAndVersionedAttrFrom(property);
|
getterDecl->copyFormalAccessAndVersionedAttrFrom(property);
|
||||||
|
getterDecl->setValidationStarted();
|
||||||
|
|
||||||
// If the enum was not imported, the derived conformance is either from the
|
// 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
|
// 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->setImplicit();
|
||||||
propDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
propDecl->copyFormalAccessAndVersionedAttrFrom(typeDecl);
|
||||||
propDecl->setInterfaceType(propertyInterfaceType);
|
propDecl->setInterfaceType(propertyInterfaceType);
|
||||||
|
propDecl->setValidationStarted();
|
||||||
|
|
||||||
// If this is supposed to be a final property, mark it as such.
|
// If this is supposed to be a final property, mark it as such.
|
||||||
assert(isFinal || !parentDC->getAsClassOrClassExtensionContext());
|
assert(isFinal || !parentDC->getAsClassOrClassExtensionContext());
|
||||||
|
|||||||
Reference in New Issue
Block a user