From 1af8ff01215f4d6ab5d5b3b1c4e2d1785a69c9c9 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 21 Aug 2015 17:57:57 +0200 Subject: add tests for state variables accessors. normal and constant fixed the issue with accessors for constant state variables --- libsolidity/Compiler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libsolidity/Compiler.cpp') diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index f0d1b38e..d86e8990 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -390,7 +390,10 @@ bool Compiler::visit(VariableDeclaration const& _variableDeclaration) m_breakTags.clear(); m_continueTags.clear(); - ExpressionCompiler(m_context, m_optimize).appendStateVariableAccessor(_variableDeclaration); + if (_variableDeclaration.isConstant()) + ExpressionCompiler(m_context, m_optimize).appendConstStateVariableAccessor(_variableDeclaration); + else + ExpressionCompiler(m_context, m_optimize).appendStateVariableAccessor(_variableDeclaration); return false; } -- cgit v1.2.3