diff --git a/AST.h b/AST.h index 72f96394f..4bb623b49 100644 --- a/AST.h +++ b/AST.h @@ -763,7 +763,7 @@ public: std::vector> getArguments() const { return {m_arguments.begin(), m_arguments.end()}; } /// Returns the referenced contract. Can only be called after type checking. - ContractDefinition const* getContract() const { return m_contract; } + ContractDefinition const* getContract() const { if (asserts(m_contract)) BOOST_THROW_EXCEPTION(InternalCompilerError()); else return m_contract; } private: ASTPointer m_contractName; diff --git a/Types.cpp b/Types.cpp index f1cd7c228..eba11cb0d 100644 --- a/Types.cpp +++ b/Types.cpp @@ -314,9 +314,9 @@ shared_ptr const& ContractType::getConstructorType() const { if (!m_constructorType) { - FunctionDefinition const* constr = m_contract.getConstructor(); - if (constr) - m_constructorType = make_shared(*constr); + FunctionDefinition const* constructor = m_contract.getConstructor(); + if (constructor) + m_constructorType = make_shared(*constructor); else m_constructorType = make_shared(TypePointers(), TypePointers()); } diff --git a/grammar.txt b/grammar.txt index 793e91882..a26f717a1 100644 --- a/grammar.txt +++ b/grammar.txt @@ -29,7 +29,7 @@ Expression = Assignment | UnaryOperation | BinaryOperation | FunctionCall | NewE MemberAccess | PrimaryExpression // The expression syntax is actually much more complicated Assignment = Expression (AssignmentOp Expression) -FunctionCall = Expression '(' ( Expression ( ',' Expression )* ) ')' +FunctionCall = Expression '(' Expression ( ',' Expression )* ')' NewExpression = 'new' Identifier '(' ( Expression ( ',' Expression )* ) ')' MemberAccess = Expression '.' Identifier IndexAccess = Expression '[' Expresison ']'