aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-10-19 22:39:16 +0800
committerchriseth <c@ethdev.com>2016-11-16 21:37:18 +0800
commit62492b67e783dd19c67850e2b8ae107aeeb83217 (patch)
treeb683d9145c39005201132e8fc631ef056ea3ba04 /libsolidity/ast
parent6172590b870832d7aa132209afb890125f301c15 (diff)
downloaddexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar.gz
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar.bz2
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar.lz
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar.xz
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.tar.zst
dexon-solidity-62492b67e783dd19c67850e2b8ae107aeeb83217.zip
Changelog entry and small fixes.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp5
-rw-r--r--libsolidity/ast/Types.cpp8
2 files changed, 8 insertions, 5 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index 717a80ee..d6aca175 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -228,8 +228,13 @@ bool ASTJsonConverter::visit(UserDefinedTypeName const& _node)
bool ASTJsonConverter::visit(FunctionTypeName const& _node)
{
+ string visibility = "internal";
+ if (_node.visibility() == Declaration::Visibility::External)
+ visibility = "external";
+
addJsonNode(_node, "FunctionTypeName", {
make_pair("payable", _node.isPayable()),
+ make_pair("visibility", visibility),
make_pair("constant", _node.isDeclaredConst())
});
return true;
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 3afbee13..15747a8b 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -2077,12 +2077,10 @@ TypePointer FunctionType::encodingType() const
TypePointer FunctionType::interfaceType(bool /*_inLibrary*/) const
{
- if (m_location != Location::External && m_location != Location::Internal)
- return TypePointer();
- if (m_location != Location::External)
- return TypePointer();
- else
+ if (m_location == Location::External)
return make_shared<IntegerType>(8 * storageBytes());
+ else
+ return TypePointer();
}
bool FunctionType::canTakeArguments(TypePointers const& _argumentTypes, TypePointer const& _selfType) const