mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Rename old form of {Generic,}FunctionType::get() to getOld()
This makes it easier to grep for and eventually remove the
remaining usages.
It also allows you to write FunctionType::get({}, ...) to call the
ArrayRef overload empty parameter list, instead of picking the Type
overload and calling it with an empty Type() value.
While I"m at it, in a few places instead of renaming just clean up
usages where it was completely mechanical to do so.
This commit is contained in:
@@ -1357,10 +1357,10 @@ void TypeChecker::completePropertyBehaviorStorage(VarDecl *VD,
|
||||
auto InitStorageRef = new (Context) DeclRefExpr(SpecializeInitStorage,
|
||||
DeclNameLoc(),
|
||||
/*implicit*/ true);
|
||||
auto InitStorageMethodTy = FunctionType::get(Context.TheEmptyTupleType,
|
||||
SubstStorageContextTy);
|
||||
auto InitStorageRefTy = FunctionType::get(SelfTypeRef->getType(),
|
||||
InitStorageMethodTy);
|
||||
auto InitStorageMethodTy = FunctionType::get({}, SubstStorageContextTy);
|
||||
|
||||
FunctionType::Param SelfParam(SelfTypeRef->getType());
|
||||
auto InitStorageRefTy = FunctionType::get({SelfParam}, InitStorageMethodTy);
|
||||
InitStorageRef->setType(InitStorageRefTy);
|
||||
|
||||
auto SelfApply = new (Context) DotSyntaxCallExpr(InitStorageRef,
|
||||
@@ -1467,15 +1467,16 @@ void TypeChecker::completePropertyBehaviorParameter(VarDecl *VD,
|
||||
|
||||
// Add the Self type back to the interface and context types.
|
||||
if (DC->isTypeContext()) {
|
||||
FunctionType::Param SelfParam(DC->getSelfInterfaceType());
|
||||
|
||||
if (DC->isGenericContext()) {
|
||||
genericSig = DC->getGenericSignatureOfContext();
|
||||
genericEnv = DC->getGenericEnvironmentOfContext();
|
||||
SubstInterfaceTy = GenericFunctionType::get(genericSig,
|
||||
DC->getSelfInterfaceType(),
|
||||
SubstInterfaceTy);
|
||||
SubstInterfaceTy =
|
||||
GenericFunctionType::get(genericSig, {SelfParam}, SubstInterfaceTy);
|
||||
} else {
|
||||
SubstInterfaceTy = FunctionType::get(DC->getSelfInterfaceType(),
|
||||
SubstInterfaceTy);
|
||||
SubstInterfaceTy =
|
||||
FunctionType::get({SelfParam}, SubstInterfaceTy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user