mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adding a location of the var/let/inout to ParamDecl
This commit is contained in:
@@ -58,9 +58,9 @@ static VarDecl *getFirstParamDecl(FuncDecl *fn) {
|
||||
static ParamDecl *buildArgument(SourceLoc loc, DeclContext *DC,
|
||||
StringRef name, Type type, bool isLet) {
|
||||
auto &context = DC->getASTContext();
|
||||
auto *param = new (context) ParamDecl(isLet, SourceLoc(), Identifier(),
|
||||
loc, context.getIdentifier(name),
|
||||
Type(), DC);
|
||||
auto *param = new (context) ParamDecl(isLet, SourceLoc(), SourceLoc(),
|
||||
Identifier(), loc,
|
||||
context.getIdentifier(name),Type(), DC);
|
||||
param->setImplicit();
|
||||
param->getTypeLoc().setType(type);
|
||||
return param;
|
||||
@@ -1422,7 +1422,8 @@ ConstructorDecl *swift::createImplicitConstructor(TypeChecker &tc,
|
||||
varType = OptionalType::get(varType);
|
||||
|
||||
// Create the parameter.
|
||||
auto *arg = new (context) ParamDecl(/*IsLet*/true, Loc, var->getName(),
|
||||
auto *arg = new (context) ParamDecl(/*IsLet*/true, SourceLoc(),
|
||||
Loc, var->getName(),
|
||||
Loc, var->getName(), varType, decl);
|
||||
arg->setImplicit();
|
||||
params.push_back(arg);
|
||||
|
||||
Reference in New Issue
Block a user