aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-11-22 09:05:26 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-11-22 10:11:22 +0800
commit455e51a608910d60348adb4b464590d976ce7fd7 (patch)
tree9037a4aea595c2da22d9422feceba7de72788e76
parentd102deaec90f6f5bfe38140b459a05215d3254f9 (diff)
downloaddexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar.gz
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar.bz2
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar.lz
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar.xz
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.tar.zst
dexon-solidity-455e51a608910d60348adb4b464590d976ce7fd7.zip
Improve cyclic constant error message
-rw-r--r--libsolidity/analysis/ConstantEvaluator.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/analysis/ConstantEvaluator.cpp b/libsolidity/analysis/ConstantEvaluator.cpp
index cb8bbc05..4d546e68 100644
--- a/libsolidity/analysis/ConstantEvaluator.cpp
+++ b/libsolidity/analysis/ConstantEvaluator.cpp
@@ -90,7 +90,7 @@ void ConstantEvaluator::endVisit(Identifier const& _identifier)
if (!value->annotation().type)
{
if (m_depth > 32)
- m_errorReporter.fatalTypeError(_identifier.location(), "Cyclic constant definition.");
+ m_errorReporter.fatalTypeError(_identifier.location(), "Cyclic constant definition (or maximum recursion depth exhausted).");
ConstantEvaluator e(*value, m_errorReporter, m_depth + 1);
}
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 0d02ac34..73c1660e 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -7379,7 +7379,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_cyclic_constant)
}
}
)";
- CHECK_ERROR(text, TypeError, "Cyclic constant definition.");
+ CHECK_ERROR(text, TypeError, "Cyclic constant definition (or maximum recursion depth exhausted).");
}
BOOST_AUTO_TEST_CASE(array_length_with_complex_cyclic_constant)
@@ -7394,7 +7394,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_complex_cyclic_constant)
}
}
)";
- CHECK_ERROR(text, TypeError, "Cyclic constant definition.");
+ CHECK_ERROR(text, TypeError, "Cyclic constant definition (or maximum recursion depth exhausted).");
}
BOOST_AUTO_TEST_CASE(array_length_with_pure_functions)