aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-01 18:26:13 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-16 19:12:43 +0800
commit22f85d5af371bb621f8735957b7519d14e3b40c9 (patch)
treeb492d0319e7fd04630dc70aeb2c994931d39a142
parent59ea19b3b957949fc53bfb5dc4e199d2196f8d18 (diff)
downloaddexon-solidity-22f85d5af371bb621f8735957b7519d14e3b40c9.tar.gz
dexon-solidity-22f85d5af371bb621f8735957b7519d14e3b40c9.tar.zst
dexon-solidity-22f85d5af371bb621f8735957b7519d14e3b40c9.zip
Update tests and error messages.
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp2
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp8
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp18
3 files changed, 14 insertions, 14 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index 51496368..92782b8d 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -333,7 +333,7 @@ void ContractCompiler::appendCalldataUnpacker(TypePointers const& _typeParameter
{
// stack: v1 v2 ... v(k-1) base_offset current_offset
TypePointer type = parameterType->decodingType();
- solAssert(type, "No decoding type found.");
+ solUnimplementedAssert(type, "No decoding type found.");
if (type->category() == Type::Category::Array)
{
auto const& arrayType = dynamic_cast<ArrayType const&>(*type);
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 6ea02673..3b657e39 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9691,10 +9691,10 @@ BOOST_AUTO_TEST_CASE(return_structs)
function f() returns (uint x, S s) {
x = 7;
s.a = 8;
- s.sub = new S[](3);
- s.sub[0][0] = 9;
- s.sub[1][0] = 10;
- s.sub[2][1] = 11;
+ s.sub = new T[](3);
+ s.sub[0].x[0] = 9;
+ s.sub[1].x[0] = 10;
+ s.sub[2].x[1] = 11;
}
}
)";
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 037bc9a0..162190bf 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3283,7 +3283,7 @@ BOOST_AUTO_TEST_CASE(library_memory_struct)
function f() public returns (S ) {}
}
)";
- CHECK_ERROR(text, TypeError, "Internal type is not allowed for public or external functions.");
+ CHECK_SUCCESS(text);
}
BOOST_AUTO_TEST_CASE(using_for_arbitrary_mismatch)
@@ -5402,7 +5402,7 @@ BOOST_AUTO_TEST_CASE(return_structs)
contract C {
struct S { uint a; T[] sub; }
struct T { uint[] x; }
- function f() returns (uint x, S s) {
+ function f() returns (uint, S) {
}
}
)";
@@ -5414,36 +5414,36 @@ BOOST_AUTO_TEST_CASE(return_recursive_structs)
char const* text = R"(
contract C {
struct S { uint a; S[] sub; }
- function f() returns (uint x, S s) {
+ function f() returns (uint, S) {
}
}
)";
- success(text);
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(return_recursive_structs2)
{
char const* text = R"(
contract C {
- struct S { uint a; S[2] sub; }
- function f() returns (uint x, S s) {
+ struct S { uint a; S[2][] sub; }
+ function f() returns (uint, S) {
}
}
)";
- CHECK_ERROR(text, TypeError, "recursive data types in external functions.");
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(return_recursive_structs3)
{
char const* text = R"(
contract C {
- struct S { uint a; S sub; }
+ struct S { uint a; S[][][] sub; }
struct T { S s; }
function f() returns (uint x, T t) {
}
}
)";
- CHECK_ERROR(text, TypeError, "recursive data types in external functions.");
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(address_checksum_type_deduction)