aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-04-17 15:03:10 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-04-17 15:03:10 +0800
commitaadffe35540d446a5723768abbe41ef841a98de6 (patch)
tree24e50774fe43dae51a95121909aa4bb5dc3b97fd /SolidityNameAndTypeResolution.cpp
parent3d199bf4d50206077c0d84122ff0ef70fc174d10 (diff)
parent0f9b0f3bc4fbebb2ab956f0178ec82442065b1bc (diff)
downloaddexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar.gz
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar.bz2
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar.lz
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar.xz
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.tar.zst
dexon-solidity-aadffe35540d446a5723768abbe41ef841a98de6.zip
Merge remote-tracking branch 'upstream/develop' into addTests
Conflicts: test/bcUncleHeaderValiditiyFiller.json
Diffstat (limited to 'SolidityNameAndTypeResolution.cpp')
-rw-r--r--SolidityNameAndTypeResolution.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp
index 74a48888..ffa78ed9 100644
--- a/SolidityNameAndTypeResolution.cpp
+++ b/SolidityNameAndTypeResolution.cpp
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
{
char const* text = "contract test {\n"
" uint256 stateVariable1;\n"
- " function fun(uint256 arg1) { var x; uint256 y; }"
+ " function fun(uint256 arg1) { uint256 y; }"
"}\n";
ETH_TEST_CHECK_NO_THROW(parseTextAndResolveNames(text), "Parsing and Name Resolving Failed");
}
@@ -1623,6 +1623,16 @@ BOOST_AUTO_TEST_CASE(bytes0_array)
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
}
+BOOST_AUTO_TEST_CASE(uninitialized_var)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (uint) { var x; return 2; }
+ }
+ )";
+ BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}