mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #136 from LianaHus/sol_error_types_refuctoring
changed the way of reporting error during contract checking
This commit is contained in:
commit
030c868f58
@ -113,7 +113,6 @@ bool CompilerStack::parse()
|
|||||||
resolveImports();
|
resolveImports();
|
||||||
|
|
||||||
m_globalContext = make_shared<GlobalContext>();
|
m_globalContext = make_shared<GlobalContext>();
|
||||||
bool success = true;
|
|
||||||
NameAndTypeResolver resolver(m_globalContext->declarations(), m_errors);
|
NameAndTypeResolver resolver(m_globalContext->declarations(), m_errors);
|
||||||
for (Source const* source: m_sourceOrder)
|
for (Source const* source: m_sourceOrder)
|
||||||
if (!resolver.registerDeclarations(*source->ast))
|
if (!resolver.registerDeclarations(*source->ast))
|
||||||
@ -124,17 +123,12 @@ bool CompilerStack::parse()
|
|||||||
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
|
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
|
||||||
{
|
{
|
||||||
m_globalContext->setCurrentContract(*contract);
|
m_globalContext->setCurrentContract(*contract);
|
||||||
success = success && resolver.updateDeclaration(*m_globalContext->currentThis());
|
if (!resolver.updateDeclaration(*m_globalContext->currentThis())) return false;
|
||||||
success = success && resolver.updateDeclaration(*m_globalContext->currentSuper());
|
if (!resolver.updateDeclaration(*m_globalContext->currentSuper())) return false;
|
||||||
success = success && resolver.resolveNamesAndTypes(*contract);
|
if (!resolver.resolveNamesAndTypes(*contract)) return false;
|
||||||
m_contracts[contract->name()].contract = contract;
|
m_contracts[contract->name()].contract = contract;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success)
|
|
||||||
{
|
|
||||||
m_parseSuccessful = false;
|
|
||||||
return m_parseSuccessful;
|
|
||||||
}
|
|
||||||
InterfaceHandler interfaceHandler;
|
InterfaceHandler interfaceHandler;
|
||||||
bool typesFine = true;
|
bool typesFine = true;
|
||||||
for (Source const* source: m_sourceOrder)
|
for (Source const* source: m_sourceOrder)
|
||||||
|
Loading…
Reference in New Issue
Block a user