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
+6 -5
View File
@@ -1216,23 +1216,24 @@ private:
};
/**
* Expression that creates a new contract, e.g. the "new SomeContract" part in "new SomeContract(1, 2)".
* Expression that creates a new contract or memory-array,
* e.g. the "new SomeContract" part in "new SomeContract(1, 2)".
*/
class NewExpression: public Expression
{
public:
NewExpression(
SourceLocation const& _location,
ASTPointer<Identifier> const& _contractName
ASTPointer<TypeName> const& _typeName
):
Expression(_location), m_contractName(_contractName) {}
Expression(_location), m_typeName(_typeName) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
Identifier const& contractName() const { return *m_contractName; }
TypeName const& typeName() const { return *m_typeName; }
private:
ASTPointer<Identifier> m_contractName;
ASTPointer<TypeName> m_typeName;
};
/**