mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Set isConstructor to false unconditionally and update to true later for constructors.
This commit is contained in:
parent
e2dac9ed39
commit
8f66390f56
@ -341,13 +341,11 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(
|
|||||||
RecursionGuard recursionGuard(*this);
|
RecursionGuard recursionGuard(*this);
|
||||||
FunctionHeaderParserResult result;
|
FunctionHeaderParserResult result;
|
||||||
|
|
||||||
if (m_scanner->currentToken() == Token::Function)
|
result.isConstructor = false;
|
||||||
// In case of old style constructors, i.e. functions with the same name as the contract,
|
|
||||||
// this is set to true below.
|
if (m_scanner->currentToken() == Token::Identifier && m_scanner->currentLiteral() == "constructor")
|
||||||
result.isConstructor = false;
|
|
||||||
else if (m_scanner->currentToken() == Token::Identifier && m_scanner->currentLiteral() == "constructor")
|
|
||||||
result.isConstructor = true;
|
result.isConstructor = true;
|
||||||
else
|
else if (m_scanner->currentToken() != Token::Function)
|
||||||
solAssert(false, "Function or constructor expected.");
|
solAssert(false, "Function or constructor expected.");
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user