diff --git a/include/swift/Sema/SemaExpr.h b/include/swift/Sema/SemaExpr.h index 705eb0b09f5..78047d5cb50 100644 --- a/include/swift/Sema/SemaExpr.h +++ b/include/swift/Sema/SemaExpr.h @@ -65,7 +65,7 @@ public: bool HasMissingSemi, llvm::SMLoc RBLoc); llvm::NullablePtr - ActOnDotIdentifier(Expr *E, llvm::SMLoc DotLoc, llvm::StringRef Identifier, + ActOnDotIdentifier(Expr *E, llvm::SMLoc DotLoc, Identifier Name, llvm::SMLoc IdentifierLoc); llvm::NullablePtr diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 983bfe69f57..65ee68cf697 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -874,7 +874,8 @@ bool Parser::parseExprPrimary(NullablePtr &Result, const char *Message) { } if (!Result.isNull()) - Result = S.expr.ActOnDotIdentifier(Result.get(), TokLoc, Tok.getText(), + Result = S.expr.ActOnDotIdentifier(Result.get(), TokLoc, + S.Context.getIdentifier(Tok.getText()), Tok.getLoc()); if (Tok.is(tok::identifier)) consumeToken(tok::identifier); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index b364fad24b4..fd30a090218 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -124,26 +124,8 @@ SemaExpr::ActOnBraceExpr(llvm::SMLoc LBLoc, llvm::NullablePtr SemaExpr::ActOnDotIdentifier(Expr *E, llvm::SMLoc DotLoc, - llvm::StringRef NameStr, - llvm::SMLoc NameLoc) { - Identifier Name = S.Context.getIdentifier(NameStr); - -#if 0 - Type *ResultTy = 0; - int FieldNo = -1; - if (SemaDotIdentifier(E, DotLoc, Name, NameLoc, ResultTy, FieldNo, *this)) - return 0; - - // If the field number is -1, the the base expression is dependent. - if (FieldNo == -1) - ; -#endif + Identifier Name, llvm::SMLoc NameLoc) { return new (S.Context) UnresolvedDotExpr(E, DotLoc, Name, NameLoc); - -#if 0 - // TODO: Eventually . can be useful for things other than tuples. - return new (S.Context) TupleElementExpr(E, DotLoc, FieldNo, NameLoc,ResultTy); -#endif } llvm::NullablePtr diff --git a/lib/Sema/TypeChecking.cpp b/lib/Sema/TypeChecking.cpp index 7f35843281a..f6210fa7558 100644 --- a/lib/Sema/TypeChecking.cpp +++ b/lib/Sema/TypeChecking.cpp @@ -572,7 +572,7 @@ namespace { FieldNo, TC)) return 0; - assert(FieldNo != -1 && "Resolved type should return a dependent expr"); + assert(FieldNo != -1 && "Resolved type shouldnt return a dependent expr"); // TODO: Eventually . can be useful for things other than tuples. return new (TC.Context)