Allow "new expressions" also for general type names.

Breaking change: If you want to send value with a contract creation, you
have to use parentheses now:

`(new ContractName).value(2 ether)(arg1, arg2)`
This commit is contained in:
chriseth
2015-11-26 13:10:12 +01:00
parent cd94aa978a
commit 30b325fdc1
9 changed files with 73 additions and 33 deletions
+1 -1
View File
@@ -939,7 +939,7 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression(
else if (m_scanner->currentToken() == Token::New)
{
expectToken(Token::New);
ASTPointer<Identifier> contractName(parseIdentifier());
ASTPointer<TypeName> contractName(parseTypeName(false));
nodeFactory.setEndPositionFromNode(contractName);
expression = nodeFactory.createNode<NewExpression>(contractName);
}