aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-12 00:38:21 +0800
committerGitHub <noreply@github.com>2017-07-12 00:38:21 +0800
commit709b1a99c10b0456987748c8dfa8f0c6dad2f7a6 (patch)
tree966cc483a3c7be01737e31d6b3cd605b60db1941
parent0b17ff1bdde6a56d3c9b48e8c40da7ad4e9a43f5 (diff)
parent1682767c6e484bb18b1be58aadcdd81ce6480aef (diff)
downloaddexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar.gz
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar.bz2
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar.lz
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar.xz
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.tar.zst
dexon-solidity-709b1a99c10b0456987748c8dfa8f0c6dad2f7a6.zip
Merge pull request #2557 from ethereum/appveyor
Add failing implicit conversion test
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 3c49051e..637ff5cc 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6182,6 +6182,18 @@ BOOST_AUTO_TEST_CASE(warn_unspecified_storage)
CHECK_WARNING(text, "is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning");
}
+BOOST_AUTO_TEST_CASE(implicit_conversion_disallowed)
+{
+ char const* text = R"(
+ contract C {
+ function f() returns (bytes4) {
+ uint32 tmp = 1;
+ return tmp;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Return argument type uint32 is not implicitly convertible to expected type (type of first return variable) bytes4.");
+}
BOOST_AUTO_TEST_SUITE_END()