mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix abstract without contract.
This commit is contained in:
parent
686b62b585
commit
0b9c842656
@ -10,6 +10,7 @@ Compiler Features:
|
||||
|
||||
|
||||
Bugfixes:
|
||||
* Parser: Fix an internal error for ``abstract`` without ``contract``.
|
||||
|
||||
|
||||
|
||||
|
@ -278,7 +278,8 @@ std::pair<ContractKind, bool> Parser::parseContractKind()
|
||||
kind = ContractKind::Library;
|
||||
break;
|
||||
default:
|
||||
solAssert(false, "Invalid contract kind.");
|
||||
parserError("Expected keyword \"contract\", \"interface\" or \"library\".");
|
||||
return std::make_pair(ContractKind::Contract, abstract);
|
||||
}
|
||||
m_scanner->next();
|
||||
return std::make_pair(kind, abstract);
|
||||
|
4
test/libsolidity/syntaxTests/abstract/abstract_only.sol
Normal file
4
test/libsolidity/syntaxTests/abstract/abstract_only.sol
Normal file
@ -0,0 +1,4 @@
|
||||
abstract
|
||||
// ----
|
||||
// ParserError: (9-9): Expected keyword "contract", "interface" or "library".
|
||||
// ParserError: (9-9): Expected identifier but got end of source
|
@ -0,0 +1,3 @@
|
||||
abstract A { }
|
||||
// ----
|
||||
// ParserError: (9-10): Expected keyword "contract", "interface" or "library".
|
Loading…
Reference in New Issue
Block a user