diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-22 19:11:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 19:11:37 +0800 |
commit | 97169e58ae44e763323f2554f124eaf1ff3db508 (patch) | |
tree | 96512e3347e61427fabb7d6d8a4c67658dda1d59 /libsolidity/ast | |
parent | f874fc28d1cb657b6d4e04fa9d93bd8d061f30c4 (diff) | |
parent | 7b0046a9aafffec4e42be7e30c283e07ca1841b9 (diff) | |
download | dexon-solidity-97169e58ae44e763323f2554f124eaf1ff3db508.tar.gz dexon-solidity-97169e58ae44e763323f2554f124eaf1ff3db508.tar.zst dexon-solidity-97169e58ae44e763323f2554f124eaf1ff3db508.zip |
Merge pull request #2734 from ethereum/reject-create-interface
Reject the creation of interface with the new statement
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index e6664895..adf41229 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2140,6 +2140,8 @@ FunctionTypePointer FunctionType::newExpressionType(ContractDefinition const& _c strings parameterNames; StateMutability stateMutability = StateMutability::NonPayable; + solAssert(_contract.contractKind() != ContractDefinition::ContractKind::Interface, ""); + if (constructor) { for (ASTPointer<VariableDeclaration> const& var: constructor->parameters()) @@ -2150,6 +2152,7 @@ FunctionTypePointer FunctionType::newExpressionType(ContractDefinition const& _c if (constructor->isPayable()) stateMutability = StateMutability::Payable; } + return make_shared<FunctionType>( parameters, TypePointers{make_shared<ContractType>(_contract)}, |