aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-03-09 00:49:14 +0800
committerGitHub <noreply@github.com>2017-03-09 00:49:14 +0800
commite364909e063cf95922b9611b3d25fb0a4199e43f (patch)
treeb235903bb5c2825f5b99e1534c59a922350c4859 /test/libsolidity
parent3f9a7758348a30c4c65a99054e1e1055d1bb20c0 (diff)
parenta3cb69b14b13a64deda8a71387e480a0eec45698 (diff)
downloaddexon-solidity-e364909e063cf95922b9611b3d25fb0a4199e43f.tar.gz
dexon-solidity-e364909e063cf95922b9611b3d25fb0a4199e43f.tar.zst
dexon-solidity-e364909e063cf95922b9611b3d25fb0a4199e43f.zip
Merge pull request #1747 from ethereum/fixICEInternalConstructor
Move privateness of constructor into AST itself.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index da3e81ed..dda7105c 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5101,6 +5101,24 @@ BOOST_AUTO_TEST_CASE(inconstructible_internal_constructor)
CHECK_ERROR(text, TypeError, "Contract with internal constructor cannot be created directly.");
}
+BOOST_AUTO_TEST_CASE(inconstructible_internal_constructor_inverted)
+{
+ // Previously, the type information for A was not yet available at the point of
+ // "new A".
+ char const* text = R"(
+ contract B {
+ A a;
+ function B() {
+ a = new A(this);
+ }
+ }
+ contract A {
+ function A(address a) internal {}
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Contract with internal constructor cannot be created directly.");
+}
+
BOOST_AUTO_TEST_CASE(constructible_internal_constructor)
{
char const* text = R"(