aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-02-14 22:35:22 +0800
committerGitHub <noreply@github.com>2017-02-14 22:35:22 +0800
commit4189ff5b68f119878807104ebac0137171c8ecd6 (patch)
treefdedef979359908033a5a26aa3abf998d274c95b /test
parent6f1f0b392ac5d3d244e65228cc8d9eebbdfe02ff (diff)
parenta791ec75e2e73130afee391958651453acc8d781 (diff)
downloaddexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar.gz
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar.bz2
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar.lz
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar.xz
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.tar.zst
dexon-solidity-4189ff5b68f119878807104ebac0137171c8ecd6.zip
Merge pull request #1620 from ethereum/refactorEntry
Refactor NameAndTypeResolver and SyntaxChecker to allow other entry points.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/Assembly.cpp3
-rw-r--r--test/libsolidity/SolidityExpressionCompiler.cpp3
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp5
3 files changed, 7 insertions, 4 deletions
diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp
index 497bfc77..c4ec0d20 100644
--- a/test/libsolidity/Assembly.cpp
+++ b/test/libsolidity/Assembly.cpp
@@ -53,7 +53,8 @@ eth::AssemblyItems compileContract(const string& _sourceCode)
BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared<Scanner>(CharStream(_sourceCode))));
BOOST_CHECK(!!sourceUnit);
- NameAndTypeResolver resolver({}, errors);
+ map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
+ NameAndTypeResolver resolver({}, scopes, errors);
solAssert(Error::containsOnlyWarnings(errors), "");
resolver.registerDeclarations(*sourceUnit);
for (ASTPointer<ASTNode> const& node: sourceUnit->nodes())
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp
index a769776e..3116aea8 100644
--- a/test/libsolidity/SolidityExpressionCompiler.cpp
+++ b/test/libsolidity/SolidityExpressionCompiler.cpp
@@ -114,7 +114,8 @@ bytes compileFirstExpression(
declarations.push_back(variable.get());
ErrorList errors;
- NameAndTypeResolver resolver(declarations, errors);
+ map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
+ NameAndTypeResolver resolver(declarations, scopes, errors);
resolver.registerDeclarations(*sourceUnit);
vector<ContractDefinition const*> inheritanceHierarchy;
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 0151d244..1a4f3cdc 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -66,7 +66,8 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false,
return make_pair(sourceUnit, errors.at(0));
std::shared_ptr<GlobalContext> globalContext = make_shared<GlobalContext>();
- NameAndTypeResolver resolver(globalContext->declarations(), errors);
+ map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
+ NameAndTypeResolver resolver(globalContext->declarations(), scopes, errors);
solAssert(Error::containsOnlyWarnings(errors), "");
resolver.registerDeclarations(*sourceUnit);
@@ -1080,7 +1081,7 @@ BOOST_AUTO_TEST_CASE(modifier_returns_value)
modifier mod(uint a) { _; return 7; }
}
)";
- CHECK_ERROR(text, TypeError, "");
+ CHECK_ERROR(text, TypeError, "Return arguments not allowed.");
}
BOOST_AUTO_TEST_CASE(state_variable_accessors)