mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove InternalCompilerError on abstract contract instantiation.
This commit is contained in:
parent
cd3ad73b5a
commit
c908c16acd
@ -2156,6 +2156,9 @@ void TypeChecker::endVisit(NewExpression const& _newExpression)
|
|||||||
if (contract->abstract() || !contract->annotation().unimplementedFunctions.empty())
|
if (contract->abstract() || !contract->annotation().unimplementedFunctions.empty())
|
||||||
m_errorReporter.typeError(_newExpression.location(), "Cannot instantiate an abstract contract.");
|
m_errorReporter.typeError(_newExpression.location(), "Cannot instantiate an abstract contract.");
|
||||||
|
|
||||||
|
if (contract->abstract())
|
||||||
|
m_errorReporter.typeError(_newExpression.location(), "Cannot instantiate an abstract contract.");
|
||||||
|
|
||||||
solAssert(!!m_scope, "");
|
solAssert(!!m_scope, "");
|
||||||
m_scope->annotation().contractDependencies.insert(contract);
|
m_scope->annotation().contractDependencies.insert(contract);
|
||||||
solAssert(
|
solAssert(
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
abstract contract AbstractContract {
|
||||||
|
constructor() public { }
|
||||||
|
function utterance() public returns (bytes32) { return "miaow"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
contract Test {
|
||||||
|
function create() public {
|
||||||
|
AbstractContract ac = new AbstractContract();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (215-235): Cannot instantiate an abstract contract.
|
Loading…
Reference in New Issue
Block a user