Adding a location of the var/let/inout to ParamDecl

This commit is contained in:
Denis Vnukov
2016-01-25 15:45:17 -08:00
parent 8f33a03d8b
commit 4f92a08987
15 changed files with 49 additions and 41 deletions

View File

@@ -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);