diff options
author | chriseth <c@ethdev.com> | 2016-09-01 02:43:24 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-06 03:28:28 +0800 |
commit | 9c64edf11052f2918f10ccd202bbfda628005562 (patch) | |
tree | 55d5cd9610711cc4c035fceb89f5b6ed0881a795 /libsolidity/analysis | |
parent | 962531af96a8a3ed6b28462d43c69d78fa48d511 (diff) | |
download | dexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.tar.gz dexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.tar.zst dexon-solidity-9c64edf11052f2918f10ccd202bbfda628005562.zip |
Change function type to include and propagate payable and constant modifier.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index c1781397..c948b90b 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -349,7 +349,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance) typeError(_inheritance.location(), "Libraries cannot be inherited from."); auto const& arguments = _inheritance.arguments(); - TypePointers parameterTypes = ContractType(*base).constructorType()->parameterTypes(); + TypePointers parameterTypes = ContractType(*base).newExpressionType()->parameterTypes(); if (!arguments.empty() && parameterTypes.size() != arguments.size()) { typeError( @@ -1264,15 +1264,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression) "Circular reference for contract creation (cannot create instance of derived or same contract)." ); - auto contractType = make_shared<ContractType>(*contract); - TypePointers parameterTypes = contractType->constructorType()->parameterTypes(); - _newExpression.annotation().type = make_shared<FunctionType>( - parameterTypes, - TypePointers{contractType}, - strings(), - strings(), - FunctionType::Location::Creation - ); + _newExpression.annotation().type = FunctionType::newExpressionType(*contract); } else if (type->category() == Type::Category::Array) { |