Default argument generator functions are not dynamically replaceable for now

This commit is contained in:
Arnold Schwaighofer
2019-03-18 11:07:05 -07:00
parent a2c651504c
commit 051a6abe49
4 changed files with 15 additions and 2 deletions

View File

@@ -1038,7 +1038,8 @@ static bool isDesignatedConstructorForClass(ValueDecl *decl) {
}
bool SILDeclRef::canBeDynamicReplacement() const {
if (kind == SILDeclRef::Kind::Destroyer)
if (kind == SILDeclRef::Kind::Destroyer ||
kind == SILDeclRef::Kind::DefaultArgGenerator)
return false;
if (kind == SILDeclRef::Kind::Initializer)
return isDesignatedConstructorForClass(getDecl());
@@ -1048,6 +1049,8 @@ bool SILDeclRef::canBeDynamicReplacement() const {
}
bool SILDeclRef::isDynamicallyReplaceable() const {
if (kind == SILDeclRef::Kind::DefaultArgGenerator)
return false;
if (isStoredPropertyInitializer())
return false;