aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--docs/common-patterns.rst2
-rw-r--r--docs/contracts.rst2
-rw-r--r--docs/control-structures.rst13
-rw-r--r--docs/frequently-asked-questions.rst2
-rw-r--r--docs/index.rst10
-rw-r--r--docs/installing-solidity.rst11
-rw-r--r--docs/layout-of-source-files.rst6
-rw-r--r--docs/security-considerations.rst2
-rw-r--r--docs/style-guide.rst2
-rw-r--r--docs/types.rst6
-rw-r--r--docs/units-and-global-variables.rst14
-rw-r--r--libsolidity/analysis/GlobalContext.cpp34
-rw-r--r--libsolidity/analysis/TypeChecker.cpp15
-rw-r--r--libsolidity/ast/Types.cpp194
-rw-r--r--libsolidity/ast/Types.h21
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp8
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp158
-rw-r--r--libsolidity/codegen/LValue.cpp4
-rw-r--r--libsolidity/formal/Why3Translator.cpp14
-rw-r--r--libsolidity/interface/CompilerStack.cpp4
-rw-r--r--libsolidity/interface/CompilerStack.h2
-rw-r--r--prerelease.txt0
-rw-r--r--scripts/Dockerfile2
-rwxr-xr-xscripts/docker_deploy.sh6
-rwxr-xr-xscripts/isolate_tests.py8
-rw-r--r--solc/jsonCompiler.cpp6
-rw-r--r--test/libsolidity/SolidityTypes.cpp2
28 files changed, 282 insertions, 270 deletions
diff --git a/.gitignore b/.gitignore
index e3e12421..47739568 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
-.commit_hash.txt
-.prerelease.txt
+commit_hash.txt
+prerelease.txt
# Compiled Object files
*.slo
diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst
index a2d7ce71..5fa84242 100644
--- a/docs/common-patterns.rst
+++ b/docs/common-patterns.rst
@@ -23,7 +23,7 @@ contract in order to become the "richest", inspired by
`King of the Ether <https://www.kingoftheether.com/>`_.
In the following contract, if you are usurped as the richest,
-you will recieve the funds of the person who has gone on to
+you will receive the funds of the person who has gone on to
become the new richest.
::
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 9145f016..2ee04675 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -1101,7 +1101,7 @@ Restrictions for libraries in comparison to contracts:
- No state variables
- Cannot inherit nor be inherited
-- Cannot recieve Ether
+- Cannot receive Ether
(These might be lifted at a later point.)
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 25bf203b..a2d34274 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -113,8 +113,8 @@ actual contract has not been created yet.
Functions of other contracts have to be called externally. For an external call,
all function arguments have to be copied to memory.
-When calling functions
-of other contracts, the amount of Wei sent with the call and the gas can be specified::
+When calling functions of other contracts, the amount of Wei sent with the call and
+the gas can be specified with special options ``.value()`` and ``.gas()``, respectively::
contract InfoFeed {
function info() payable returns (uint ret) { return 42; }
@@ -127,8 +127,8 @@ of other contracts, the amount of Wei sent with the call and the gas can be spec
function callFeed() { feed.info.value(10).gas(800)(); }
}
-The modifier ``payable`` has to be used for ``info``, because otherwise,
-we would not be able to send Ether to it in the call ``feed.info.value(10).gas(800)()``.
+The modifier ``payable`` has to be used for ``info``, because otherwise, the `.value()`
+option would not be available.
Note that the expression ``InfoFeed(addr)`` performs an explicit type conversion stating
that "we know that the type of the contract at the given address is ``InfoFeed``" and
@@ -235,7 +235,7 @@ creation-dependencies are not possible.
}
}
-As seen in the example, it is possible to forward Ether to the creation,
+As seen in the example, it is possible to forward Ether to the creation using the ``.value()`` option,
but it is not possible to limit the amount of gas. If the creation fails
(due to out-of-stack, not enough balance or other problems), an exception
is thrown.
@@ -399,6 +399,7 @@ Currently, Solidity automatically generates a runtime exception in the following
#. If you call ``assert`` with an argument that evaluates to false.
While a user-provided exception is generated in the following situations:
+
#. Calling ``throw``.
#. Calling ``require`` with an argument that evaluates to ``false``.
@@ -411,4 +412,4 @@ did not occur. Because we want to retain the atomicity of transactions, the safe
If contracts are written so that ``assert`` is only used to test internal conditions and ``require``
is used in case of malformed input, a formal analysis tool that verifies that the invalid
-opcode can never be reached can be used to check for the absence of errors assuming valid inputs. \ No newline at end of file
+opcode can never be reached can be used to check for the absence of errors assuming valid inputs.
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index 8a68ae5b..639eb83e 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -68,7 +68,7 @@ creator. Save it. Then ``selfdestruct(creator);`` to kill and return funds.
Note that if you ``import "mortal"`` at the top of your contracts and declare
``contract SomeContract is mortal { ...`` and compile with a compiler that already
-has it (which includes `browser-solidity <https://ethereum.github.io/browser-solidity/>`_), then
+has it (which includes `Remix <https://remix.ethereum.org/>`_), then
``kill()`` is taken care of for you. Once a contract is "mortal", then you can
``contractname.kill.sendTransaction({from:eth.coinbase})``, just the same as my
examples.
diff --git a/docs/index.rst b/docs/index.rst
index fc1a4231..61cff7ac 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -2,7 +2,7 @@ Solidity
========
Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript
-and it is designed to target the Ethereum Virtual Machine.
+and it is designed to target the Ethereum Virtual Machine (EVM).
Solidity is statically typed, supports inheritance, libraries and complex
user-defined types among other features.
@@ -11,8 +11,8 @@ As you will see, it is possible to create contracts for voting,
crowdfunding, blind auctions, multi-signature wallets and more.
.. note::
- The best way to try out Solidity right now is using the
- `Browser-Based Compiler <https://ethereum.github.io/browser-solidity/>`_
+ The best way to try out Solidity right now is using
+ `Remix <https://remix.ethereum.org/>`_
(it can take a while to load, please be patient).
Useful links
@@ -33,7 +33,7 @@ Useful links
Available Solidity Integrations
-------------------------------
-* `Browser-Based Compiler <https://ethereum.github.io/browser-solidity/>`_
+* `Remix <https://remix.ethereum.org/>`_
Browser-based IDE with integrated compiler and Solidity runtime environment without server-side components.
* `Ethereum Studio <https://live.ether.camp/>`_
@@ -109,7 +109,7 @@ and the :ref:`Ethereum Virtual Machine <the-ethereum-virtual-machine>`.
The next section will explain several *features* of Solidity by giving
useful :ref:`example contracts <voting>`
Remember that you can always try out the contracts
-`in your browser <https://ethereum.github.io/browser-solidity>`_!
+`in your browser <https://remix.ethereum.org>`_!
The last and most extensive section will cover all aspects of Solidity in depth.
diff --git a/docs/installing-solidity.rst b/docs/installing-solidity.rst
index fb405475..a2a3c3da 100644
--- a/docs/installing-solidity.rst
+++ b/docs/installing-solidity.rst
@@ -15,11 +15,11 @@ are not guaranteed to be working and despite best efforts they might contain und
and/or broken changes. We recommend using the latest release. Package installers below
will use the latest release.
-Browser-Solidity
-================
+Remix
+=====
If you just want to try Solidity for small contracts, you
-can try `browser-solidity <https://ethereum.github.io/browser-solidity>`_
+can try `Remix <https://remix.ethereum.org/>`_
which does not need any installation. If you want to use it
without connection to the Internet, you can go to
https://github.com/ethereum/browser-solidity/tree/gh-pages and
@@ -31,7 +31,7 @@ npm / Node.js
This is probably the most portable and most convenient way to install Solidity locally.
A platform-independent JavaScript library is provided by compiling the C++ source
-into JavaScript using Emscripten. It can be used in projects directly (such as Browser-Solidity).
+into JavaScript using Emscripten. It can be used in projects directly (such as Remix).
Please refer to the `solc-js <https://github.com/ethereum/solc-js>`_ repository for instructions.
It also contains a commandline tool called `solcjs`, which can be installed via npm:
@@ -250,6 +250,7 @@ The version string in detail
============================
The Solidity version string contains four parts:
+
- the version number
- pre-release tag, usually set to ``develop.YYYY.MM.DD`` or ``nightly.YYYY.MM.DD``
- commit in the format of ``commit.GITHASH``
@@ -280,4 +281,4 @@ Example:
3. a breaking change is introduced - version is bumped to 0.5.0
4. the 0.5.0 release is made
-This behaviour works well with the version pragma.
+This behaviour works well with the :ref:`version pragma <version_pragma>`.
diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst
index 1e27b7c0..05708964 100644
--- a/docs/layout-of-source-files.rst
+++ b/docs/layout-of-source-files.rst
@@ -7,6 +7,8 @@ and pragma directives.
.. index:: ! pragma, version
+.. _version_pragma:
+
Version Pragma
==============
@@ -151,9 +153,9 @@ remapping ``=/``.
If there are multiple remappings that lead to a valid file, the remapping
with the longest common prefix is chosen.
-**browser-solidity**:
+**Remix**:
-The `browser-based compiler <https://ethereum.github.io/browser-solidity>`_
+`Remix <https://remix.ethereum.org/>`_
provides an automatic remapping for github and will also automatically retrieve
the file over the network:
You can import the iterable mapping by e.g.
diff --git a/docs/security-considerations.rst b/docs/security-considerations.rst
index 77e1bf08..7c3f87ee 100644
--- a/docs/security-considerations.rst
+++ b/docs/security-considerations.rst
@@ -117,7 +117,7 @@ Sending and Receiving Ether
During the execution of the fallback function, the contract can only rely
on the "gas stipend" (2300 gas) being available to it at that time. This stipend is not enough to access storage in any way.
To be sure that your contract can receive Ether in that way, check the gas requirements of the fallback function
- (for example in the "details" section in browser-solidity).
+ (for example in the "details" section in Remix).
- There is a way to forward more gas to the receiving contract using
``addr.call.value(x)()``. This is essentially the same as ``addr.send(x)``,
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index 9aae3d7b..0742d2e9 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -164,7 +164,7 @@ Functions should be grouped according to their visibility and ordered:
- internal
- private
-Within a grouping, place the `constant` functions last.
+Within a grouping, place the ``constant`` functions last.
Yes::
diff --git a/docs/types.rst b/docs/types.rst
index 243a9a0c..60235ad2 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -123,6 +123,8 @@ In a similar way, the function ``delegatecall`` can be used: The difference is t
All three functions ``call``, ``delegatecall`` and ``callcode`` are very low-level functions and should only be used as a *last resort* as they break the type-safety of Solidity.
+The ``.gas()`` option is available on all three methods, while the ``.value()`` option is not supported for ``delegatecall``.
+
.. note::
All contracts inherit the members of address, so it is possible to query the balance of the
current contract using ``this.balance``.
@@ -232,7 +234,7 @@ a non-rational number).
Integer literals and rational number literals belong to number literal types.
Moreover, all number literal expressions (i.e. the expressions that
contain only number literals and operators) belong to number literal
- types. So the number literal expressions `1 + 2` and `2 + 1` both
+ types. So the number literal expressions ``1 + 2`` and ``2 + 1`` both
belong to the same number literal type for the rational number three.
.. note::
@@ -261,7 +263,7 @@ a non-rational number).
String Literals
---------------
-String literals are written with either double or single-quotes (``"foo"`` or ``'bar'``). They do not imply trailing zeroes as in C; `"foo"`` represents three bytes not four. As with integer literals, their type can vary, but they are implicitly convertible to ``bytes1``, ..., ``bytes32``, if they fit, to ``bytes`` and to ``string``.
+String literals are written with either double or single-quotes (``"foo"`` or ``'bar'``). They do not imply trailing zeroes as in C; ``"foo"`` represents three bytes not four. As with integer literals, their type can vary, but they are implicitly convertible to ``bytes1``, ..., ``bytes32``, if they fit, to ``bytes`` and to ``string``.
String literals support escape characters, such as ``\n``, ``\xNN`` and ``\uNNNN``. ``\xNN`` takes a hex value and inserts the appropriate byte, while ``\uNNNN`` takes a Unicode codepoint and inserts an UTF-8 sequence.
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index 49fe5d84..7a43343f 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -93,7 +93,7 @@ Mathematical and Cryptographic Functions
``keccak256(...) returns (bytes32)``:
compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments
``sha3(...) returns (bytes32)``:
- alias to `keccak256()`
+ alias to ``keccak256()``
``sha256(...) returns (bytes32)``:
compute the SHA-256 hash of the (tightly packed) arguments
``ripemd160(...) returns (bytes20)``:
@@ -128,17 +128,23 @@ Address Related
``<address>.balance`` (``uint256``):
balance of the :ref:`address` in Wei
-``<address>.send(uint256 amount) returns (bool)``:
- send given amount of Wei to :ref:`address`, returns ``false`` on failure
``<address>.transfer(uint256 amount)``:
send given amount of Wei to :ref:`address`, throws on failure
+``<address>.send(uint256 amount) returns (bool)``:
+ send given amount of Wei to :ref:`address`, returns ``false`` on failure
+``<address>.call(...) returns (bool)``:
+ issue low-level ``CALL``, returns ``false`` on failure
+``<address>.callcode(...) returns (bool)``:
+ issue low-level ``CALLCODE``, returns ``false`` on failure
+``<address>.delegatecall(...) returns (bool)``:
+ issue low-level ``DELEGATECALL``, returns ``false`` on failure
For more information, see the section on :ref:`address`.
.. warning::
There are some dangers in using ``send``: The transfer fails if the call stack depth is at 1024
(this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order
- to make safe Ether transfers, always check the return value of ``send`` or even better:
+ to make safe Ether transfers, always check the return value of ``send``, use ``transfer`` or even better:
Use a pattern where the recipient withdraws the money.
.. index:: this, selfdestruct
diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp
index d8f1603a..a54b8c8d 100644
--- a/libsolidity/analysis/GlobalContext.cpp
+++ b/libsolidity/analysis/GlobalContext.cpp
@@ -39,39 +39,39 @@ m_magicVariables(vector<shared_ptr<MagicVariableDeclaration const>>{make_shared<
make_shared<MagicVariableDeclaration>("tx", make_shared<MagicType>(MagicType::Kind::Transaction)),
make_shared<MagicVariableDeclaration>("now", make_shared<IntegerType>(256)),
make_shared<MagicVariableDeclaration>("suicide",
- make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Location::Selfdestruct)),
+ make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Kind::Selfdestruct)),
make_shared<MagicVariableDeclaration>("selfdestruct",
- make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Location::Selfdestruct)),
+ make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Kind::Selfdestruct)),
make_shared<MagicVariableDeclaration>("addmod",
- make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Location::AddMod)),
+ make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Kind::AddMod)),
make_shared<MagicVariableDeclaration>("mulmod",
- make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Location::MulMod)),
+ make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Kind::MulMod)),
make_shared<MagicVariableDeclaration>("sha3",
- make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Location::SHA3, true)),
+ make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Kind::SHA3, true)),
make_shared<MagicVariableDeclaration>("keccak256",
- make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Location::SHA3, true)),
+ make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Kind::SHA3, true)),
make_shared<MagicVariableDeclaration>("log0",
- make_shared<FunctionType>(strings{"bytes32"}, strings{}, FunctionType::Location::Log0)),
+ make_shared<FunctionType>(strings{"bytes32"}, strings{}, FunctionType::Kind::Log0)),
make_shared<MagicVariableDeclaration>("log1",
- make_shared<FunctionType>(strings{"bytes32", "bytes32"}, strings{}, FunctionType::Location::Log1)),
+ make_shared<FunctionType>(strings{"bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log1)),
make_shared<MagicVariableDeclaration>("log2",
- make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Location::Log2)),
+ make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log2)),
make_shared<MagicVariableDeclaration>("log3",
- make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Location::Log3)),
+ make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log3)),
make_shared<MagicVariableDeclaration>("log4",
- make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Location::Log4)),
+ make_shared<FunctionType>(strings{"bytes32", "bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log4)),
make_shared<MagicVariableDeclaration>("sha256",
- make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Location::SHA256, true)),
+ make_shared<FunctionType>(strings(), strings{"bytes32"}, FunctionType::Kind::SHA256, true)),
make_shared<MagicVariableDeclaration>("ecrecover",
- make_shared<FunctionType>(strings{"bytes32", "uint8", "bytes32", "bytes32"}, strings{"address"}, FunctionType::Location::ECRecover)),
+ make_shared<FunctionType>(strings{"bytes32", "uint8", "bytes32", "bytes32"}, strings{"address"}, FunctionType::Kind::ECRecover)),
make_shared<MagicVariableDeclaration>("ripemd160",
- make_shared<FunctionType>(strings(), strings{"bytes20"}, FunctionType::Location::RIPEMD160, true)),
+ make_shared<FunctionType>(strings(), strings{"bytes20"}, FunctionType::Kind::RIPEMD160, true)),
make_shared<MagicVariableDeclaration>("assert",
- make_shared<FunctionType>(strings{"bool"}, strings{}, FunctionType::Location::Assert)),
+ make_shared<FunctionType>(strings{"bool"}, strings{}, FunctionType::Kind::Assert)),
make_shared<MagicVariableDeclaration>("require",
- make_shared<FunctionType>(strings{"bool"}, strings{}, FunctionType::Location::Require)),
+ make_shared<FunctionType>(strings{"bool"}, strings{}, FunctionType::Kind::Require)),
make_shared<MagicVariableDeclaration>("revert",
- make_shared<FunctionType>(strings(), strings(), FunctionType::Location::Revert))})
+ make_shared<FunctionType>(strings(), strings(), FunctionType::Kind::Revert))})
{
}
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 512493cd..34ed8129 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -582,7 +582,7 @@ bool TypeChecker::visit(EventDefinition const& _eventDef)
void TypeChecker::endVisit(FunctionTypeName const& _funType)
{
FunctionType const& fun = dynamic_cast<FunctionType const&>(*_funType.annotation().type);
- if (fun.location() == FunctionType::Location::External)
+ if (fun.kind() == FunctionType::Kind::External)
if (!fun.canBeUsedExternally(false))
typeError(_funType.location(), "External function type uses internal types.");
}
@@ -886,15 +886,14 @@ void TypeChecker::endVisit(ExpressionStatement const& _statement)
{
if (auto callType = dynamic_cast<FunctionType const*>(type(call->expression()).get()))
{
- using Location = FunctionType::Location;
- Location location = callType->location();
+ auto kind = callType->kind();
if (
- location == Location::Bare ||
- location == Location::BareCallCode ||
- location == Location::BareDelegateCall
+ kind == FunctionType::Kind::Bare ||
+ kind == FunctionType::Kind::BareCallCode ||
+ kind == FunctionType::Kind::BareDelegateCall
)
warning(_statement.location(), "Return value of low-level calls not used.");
- else if (location == Location::Send)
+ else if (kind == FunctionType::Kind::Send)
warning(_statement.location(), "Failure condition of 'send' ignored. Consider using 'transfer' instead.");
}
}
@@ -1387,7 +1386,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression)
TypePointers{type},
strings(),
strings(),
- FunctionType::Location::ObjectCreation
+ FunctionType::Kind::ObjectCreation
);
_newExpression.annotation().isPure = true;
}
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index e7f53422..41ee6498 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -462,11 +462,11 @@ MemberList::MemberMap IntegerType::nativeMembers(ContractDefinition const*) cons
if (isAddress())
return {
{"balance", make_shared<IntegerType >(256)},
- {"call", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Location::Bare, true, false, true)},
- {"callcode", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Location::BareCallCode, true, false, true)},
- {"delegatecall", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Location::BareDelegateCall, true)},
- {"send", make_shared<FunctionType>(strings{"uint"}, strings{"bool"}, FunctionType::Location::Send)},
- {"transfer", make_shared<FunctionType>(strings{"uint"}, strings(), FunctionType::Location::Transfer)}
+ {"call", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::Bare, true, false, true)},
+ {"callcode", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareCallCode, true, false, true)},
+ {"delegatecall", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareDelegateCall, true)},
+ {"send", make_shared<FunctionType>(strings{"uint"}, strings{"bool"}, FunctionType::Kind::Send)},
+ {"transfer", make_shared<FunctionType>(strings{"uint"}, strings(), FunctionType::Kind::Transfer)}
};
else
return MemberList::MemberMap();
@@ -1466,7 +1466,7 @@ MemberList::MemberMap ArrayType::nativeMembers(ContractDefinition const*) const
TypePointers{make_shared<IntegerType>(256)},
strings{string()},
strings{string()},
- isByteArray() ? FunctionType::Location::ByteArrayPush : FunctionType::Location::ArrayPush
+ isByteArray() ? FunctionType::Kind::ByteArrayPush : FunctionType::Kind::ArrayPush
)});
}
return members;
@@ -1766,7 +1766,7 @@ FunctionTypePointer StructType::constructorType() const
TypePointers{copyForLocation(DataLocation::Memory, false)},
paramNames,
strings(),
- FunctionType::Location::Internal
+ FunctionType::Kind::Internal
);
}
@@ -1967,7 +1967,7 @@ TypePointer TupleType::closestTemporaryType(TypePointer const& _targetType) cons
}
FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal):
- m_location(_isInternal ? Location::Internal : Location::External),
+ m_kind(_isInternal ? Kind::Internal : Kind::External),
m_isConstant(_function.isDeclaredConst()),
m_isPayable(_isInternal ? false : _function.isPayable()),
m_declaration(&_function)
@@ -1998,7 +1998,7 @@ FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal
}
FunctionType::FunctionType(VariableDeclaration const& _varDecl):
- m_location(Location::External), m_isConstant(true), m_declaration(&_varDecl)
+ m_kind(Kind::External), m_isConstant(true), m_declaration(&_varDecl)
{
TypePointers paramTypes;
vector<string> paramNames;
@@ -2058,7 +2058,7 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl):
}
FunctionType::FunctionType(EventDefinition const& _event):
- m_location(Location::Event), m_isConstant(true), m_declaration(&_event)
+ m_kind(Kind::Event), m_isConstant(true), m_declaration(&_event)
{
TypePointers params;
vector<string> paramNames;
@@ -2074,19 +2074,19 @@ FunctionType::FunctionType(EventDefinition const& _event):
}
FunctionType::FunctionType(FunctionTypeName const& _typeName):
- m_location(_typeName.visibility() == VariableDeclaration::Visibility::External ? Location::External : Location::Internal),
+ m_kind(_typeName.visibility() == VariableDeclaration::Visibility::External ? Kind::External : Kind::Internal),
m_isConstant(_typeName.isDeclaredConst()),
m_isPayable(_typeName.isPayable())
{
if (_typeName.isPayable())
{
- solAssert(m_location == Location::External, "Internal payable function type used.");
+ solAssert(m_kind == Kind::External, "Internal payable function type used.");
solAssert(!m_isConstant, "Payable constant function");
}
for (auto const& t: _typeName.parameterTypes())
{
solAssert(t->annotation().type, "Type not set for parameter.");
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
solAssert(
t->annotation().type->canBeUsedExternally(false),
"Internal type used as parameter for external function."
@@ -2096,7 +2096,7 @@ FunctionType::FunctionType(FunctionTypeName const& _typeName):
for (auto const& t: _typeName.returnParameterTypes())
{
solAssert(t->annotation().type, "Type not set for return parameter.");
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
solAssert(
t->annotation().type->canBeUsedExternally(false),
"Internal type used as return parameter for external function."
@@ -2126,7 +2126,7 @@ FunctionTypePointer FunctionType::newExpressionType(ContractDefinition const& _c
TypePointers{make_shared<ContractType>(_contract)},
parameterNames,
strings{""},
- Location::Creation,
+ Kind::Creation,
false,
nullptr,
false,
@@ -2151,38 +2151,38 @@ TypePointers FunctionType::parameterTypes() const
string FunctionType::identifier() const
{
string id = "t_function_";
- switch (location())
+ switch (m_kind)
{
- case Location::Internal: id += "internal"; break;
- case Location::External: id += "external"; break;
- case Location::CallCode: id += "callcode"; break;
- case Location::DelegateCall: id += "delegatecall"; break;
- case Location::Bare: id += "bare"; break;
- case Location::BareCallCode: id += "barecallcode"; break;
- case Location::BareDelegateCall: id += "baredelegatecall"; break;
- case Location::Creation: id += "creation"; break;
- case Location::Send: id += "send"; break;
- case Location::Transfer: id += "transfer"; break;
- case Location::SHA3: id += "sha3"; break;
- case Location::Selfdestruct: id += "selfdestruct"; break;
- case Location::Revert: id += "revert"; break;
- case Location::ECRecover: id += "ecrecover"; break;
- case Location::SHA256: id += "sha256"; break;
- case Location::RIPEMD160: id += "ripemd160"; break;
- case Location::Log0: id += "log0"; break;
- case Location::Log1: id += "log1"; break;
- case Location::Log2: id += "log2"; break;
- case Location::Log3: id += "log3"; break;
- case Location::Log4: id += "log4"; break;
- case Location::Event: id += "event"; break;
- case Location::SetGas: id += "setgas"; break;
- case Location::SetValue: id += "setvalue"; break;
- case Location::BlockHash: id += "blockhash"; break;
- case Location::AddMod: id += "addmod"; break;
- case Location::MulMod: id += "mulmod"; break;
- case Location::ArrayPush: id += "arraypush"; break;
- case Location::ByteArrayPush: id += "bytearraypush"; break;
- case Location::ObjectCreation: id += "objectcreation"; break;
+ case Kind::Internal: id += "internal"; break;
+ case Kind::External: id += "external"; break;
+ case Kind::CallCode: id += "callcode"; break;
+ case Kind::DelegateCall: id += "delegatecall"; break;
+ case Kind::Bare: id += "bare"; break;
+ case Kind::BareCallCode: id += "barecallcode"; break;
+ case Kind::BareDelegateCall: id += "baredelegatecall"; break;
+ case Kind::Creation: id += "creation"; break;
+ case Kind::Send: id += "send"; break;
+ case Kind::Transfer: id += "transfer"; break;
+ case Kind::SHA3: id += "sha3"; break;
+ case Kind::Selfdestruct: id += "selfdestruct"; break;
+ case Kind::Revert: id += "revert"; break;
+ case Kind::ECRecover: id += "ecrecover"; break;
+ case Kind::SHA256: id += "sha256"; break;
+ case Kind::RIPEMD160: id += "ripemd160"; break;
+ case Kind::Log0: id += "log0"; break;
+ case Kind::Log1: id += "log1"; break;
+ case Kind::Log2: id += "log2"; break;
+ case Kind::Log3: id += "log3"; break;
+ case Kind::Log4: id += "log4"; break;
+ case Kind::Event: id += "event"; break;
+ case Kind::SetGas: id += "setgas"; break;
+ case Kind::SetValue: id += "setvalue"; break;
+ case Kind::BlockHash: id += "blockhash"; break;
+ case Kind::AddMod: id += "addmod"; break;
+ case Kind::MulMod: id += "mulmod"; break;
+ case Kind::ArrayPush: id += "arraypush"; break;
+ case Kind::ByteArrayPush: id += "bytearraypush"; break;
+ case Kind::ObjectCreation: id += "objectcreation"; break;
default: solAssert(false, "Unknown function location."); break;
}
if (isConstant())
@@ -2203,7 +2203,7 @@ bool FunctionType::operator==(Type const& _other) const
return false;
FunctionType const& other = dynamic_cast<FunctionType const&>(_other);
- if (m_location != other.m_location)
+ if (m_kind != other.m_kind)
return false;
if (m_isConstant != other.isConstant())
return false;
@@ -2231,7 +2231,7 @@ bool FunctionType::operator==(Type const& _other) const
bool FunctionType::isExplicitlyConvertibleTo(Type const& _convertTo) const
{
- if (m_location == Location::External && _convertTo.category() == Category::Integer)
+ if (m_kind == Kind::External && _convertTo.category() == Category::Integer)
{
IntegerType const& convertTo = dynamic_cast<IntegerType const&>(_convertTo);
if (convertTo.isAddress())
@@ -2249,7 +2249,7 @@ TypePointer FunctionType::unaryOperatorResult(Token::Value _operator) const
string FunctionType::canonicalName(bool) const
{
- solAssert(m_location == Location::External, "");
+ solAssert(m_kind == Kind::External, "");
return "function";
}
@@ -2263,7 +2263,7 @@ string FunctionType::toString(bool _short) const
name += " constant";
if (m_isPayable)
name += " payable";
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
name += " external";
if (!m_returnParameterTypes.empty())
{
@@ -2285,7 +2285,7 @@ unsigned FunctionType::calldataEncodedSize(bool _padded) const
u256 FunctionType::storageSize() const
{
- if (m_location == Location::External || m_location == Location::Internal)
+ if (m_kind == Kind::External || m_kind == Kind::Internal)
return 1;
else
BOOST_THROW_EXCEPTION(
@@ -2295,9 +2295,9 @@ u256 FunctionType::storageSize() const
unsigned FunctionType::storageBytes() const
{
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
return 20 + 4;
- else if (m_location == Location::Internal)
+ else if (m_kind == Kind::Internal)
return 8; // it should really not be possible to create larger programs
else
BOOST_THROW_EXCEPTION(
@@ -2307,21 +2307,21 @@ unsigned FunctionType::storageBytes() const
unsigned FunctionType::sizeOnStack() const
{
- Location location = m_location;
- if (m_location == Location::SetGas || m_location == Location::SetValue)
+ Kind kind = m_kind;
+ if (m_kind == Kind::SetGas || m_kind == Kind::SetValue)
{
solAssert(m_returnParameterTypes.size() == 1, "");
- location = dynamic_cast<FunctionType const&>(*m_returnParameterTypes.front()).m_location;
+ kind = dynamic_cast<FunctionType const&>(*m_returnParameterTypes.front()).m_kind;
}
unsigned size = 0;
- if (location == Location::External || location == Location::CallCode || location == Location::DelegateCall)
+ if (kind == Kind::External || kind == Kind::CallCode || kind == Kind::DelegateCall)
size = 2;
- else if (location == Location::Bare || location == Location::BareCallCode || location == Location::BareDelegateCall)
+ else if (kind == Kind::Bare || kind == Kind::BareCallCode || kind == Kind::BareDelegateCall)
size = 1;
- else if (location == Location::Internal)
+ else if (kind == Kind::Internal)
size = 1;
- else if (location == Location::ArrayPush || location == Location::ByteArrayPush)
+ else if (kind == Kind::ArrayPush || kind == Kind::ByteArrayPush)
size = 1;
if (m_gasSet)
size++;
@@ -2362,26 +2362,26 @@ FunctionTypePointer FunctionType::interfaceFunctionType() const
return make_shared<FunctionType>(
paramTypes, retParamTypes,
m_parameterNames, m_returnParameterNames,
- m_location, m_arbitraryParameters,
+ m_kind, m_arbitraryParameters,
m_declaration, m_isConstant, m_isPayable
);
}
MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) const
{
- switch (m_location)
+ switch (m_kind)
{
- case Location::External:
- case Location::Creation:
- case Location::ECRecover:
- case Location::SHA256:
- case Location::RIPEMD160:
- case Location::Bare:
- case Location::BareCallCode:
- case Location::BareDelegateCall:
+ case Kind::External:
+ case Kind::Creation:
+ case Kind::ECRecover:
+ case Kind::SHA256:
+ case Kind::RIPEMD160:
+ case Kind::Bare:
+ case Kind::BareCallCode:
+ case Kind::BareDelegateCall:
{
MemberList::MemberMap members;
- if (m_location != Location::BareDelegateCall && m_location != Location::DelegateCall)
+ if (m_kind != Kind::BareDelegateCall && m_kind != Kind::DelegateCall)
{
if (m_isPayable)
members.push_back(MemberList::Member(
@@ -2391,7 +2391,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
TypePointers{copyAndSetGasOrValue(false, true)},
strings(),
strings(),
- Location::SetValue,
+ Kind::SetValue,
false,
nullptr,
false,
@@ -2401,7 +2401,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
)
));
}
- if (m_location != Location::Creation)
+ if (m_kind != Kind::Creation)
members.push_back(MemberList::Member(
"gas",
make_shared<FunctionType>(
@@ -2409,7 +2409,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
TypePointers{copyAndSetGasOrValue(true, false)},
strings(),
strings(),
- Location::SetGas,
+ Kind::SetGas,
false,
nullptr,
false,
@@ -2428,7 +2428,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
TypePointer FunctionType::encodingType() const
{
// Only external functions can be encoded, internal functions cannot leave code boundaries.
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
return shared_from_this();
else
return TypePointer();
@@ -2436,7 +2436,7 @@ TypePointer FunctionType::encodingType() const
TypePointer FunctionType::interfaceType(bool /*_inLibrary*/) const
{
- if (m_location == Location::External)
+ if (m_kind == Kind::External)
return shared_from_this();
else
return TypePointer();
@@ -2478,14 +2478,14 @@ bool FunctionType::hasEqualArgumentTypes(FunctionType const& _other) const
bool FunctionType::isBareCall() const
{
- switch (m_location)
+ switch (m_kind)
{
- case Location::Bare:
- case Location::BareCallCode:
- case Location::BareDelegateCall:
- case Location::ECRecover:
- case Location::SHA256:
- case Location::RIPEMD160:
+ case Kind::Bare:
+ case Kind::BareCallCode:
+ case Kind::BareDelegateCall:
+ case Kind::ECRecover:
+ case Kind::SHA256:
+ case Kind::RIPEMD160:
return true;
default:
return false;
@@ -2520,13 +2520,13 @@ u256 FunctionType::externalIdentifier() const
bool FunctionType::isPure() const
{
return
- m_location == Location::SHA3 ||
- m_location == Location::ECRecover ||
- m_location == Location::SHA256 ||
- m_location == Location::RIPEMD160 ||
- m_location == Location::AddMod ||
- m_location == Location::MulMod ||
- m_location == Location::ObjectCreation;
+ m_kind == Kind::SHA3 ||
+ m_kind == Kind::ECRecover ||
+ m_kind == Kind::SHA256 ||
+ m_kind == Kind::RIPEMD160 ||
+ m_kind == Kind::AddMod ||
+ m_kind == Kind::MulMod ||
+ m_kind == Kind::ObjectCreation;
}
TypePointers FunctionType::parseElementaryTypeVector(strings const& _types)
@@ -2545,7 +2545,7 @@ TypePointer FunctionType::copyAndSetGasOrValue(bool _setGas, bool _setValue) con
m_returnParameterTypes,
m_parameterNames,
m_returnParameterNames,
- m_location,
+ m_kind,
m_arbitraryParameters,
m_declaration,
m_isConstant,
@@ -2571,18 +2571,18 @@ FunctionTypePointer FunctionType::asMemberFunction(bool _inLibrary, bool _bound)
parameterTypes.push_back(t);
}
- Location location = m_location;
+ Kind kind = m_kind;
if (_inLibrary)
{
solAssert(!!m_declaration, "Declaration has to be available.");
if (!m_declaration->isPublic())
- location = Location::Internal; // will be inlined
+ kind = Kind::Internal; // will be inlined
else
- location = Location::DelegateCall;
+ kind = Kind::DelegateCall;
}
TypePointers returnParameterTypes = m_returnParameterTypes;
- if (location != Location::Internal)
+ if (kind != Kind::Internal)
{
// Alter dynamic types to be non-accessible.
for (auto& param: returnParameterTypes)
@@ -2595,7 +2595,7 @@ FunctionTypePointer FunctionType::asMemberFunction(bool _inLibrary, bool _bound)
returnParameterTypes,
m_parameterNames,
m_returnParameterNames,
- location,
+ kind,
m_arbitraryParameters,
m_declaration,
m_isConstant,
@@ -2821,7 +2821,7 @@ MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const*) const
return MemberList::MemberMap({
{"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
{"timestamp", make_shared<IntegerType>(256)},
- {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)},
+ {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Kind::BlockHash)},
{"difficulty", make_shared<IntegerType>(256)},
{"number", make_shared<IntegerType>(256)},
{"gaslimit", make_shared<IntegerType>(256)}
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index 78326aa6..c4ffc44c 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -817,8 +817,7 @@ class FunctionType: public Type
{
public:
/// How this function is invoked on the EVM.
- /// @todo This documentation is outdated, and Location should rather be named "Type"
- enum class Location
+ enum class Kind
{
Internal, ///< stack-call using plain JUMP
External, ///< external call using CALL
@@ -868,7 +867,7 @@ public:
FunctionType(
strings const& _parameterTypes,
strings const& _returnParameterTypes,
- Location _location = Location::Internal,
+ Kind _kind = Kind::Internal,
bool _arbitraryParameters = false,
bool _constant = false,
bool _payable = false
@@ -877,7 +876,7 @@ public:
parseElementaryTypeVector(_returnParameterTypes),
strings(),
strings(),
- _location,
+ _kind,
_arbitraryParameters,
nullptr,
_constant,
@@ -895,7 +894,7 @@ public:
TypePointers const& _returnParameterTypes,
strings _parameterNames = strings(),
strings _returnParameterNames = strings(),
- Location _location = Location::Internal,
+ Kind _kind = Kind::Internal,
bool _arbitraryParameters = false,
Declaration const* _declaration = nullptr,
bool _isConstant = false,
@@ -908,7 +907,7 @@ public:
m_returnParameterTypes(_returnParameterTypes),
m_parameterNames(_parameterNames),
m_returnParameterNames(_returnParameterNames),
- m_location(_location),
+ m_kind(_kind),
m_arbitraryParameters(_arbitraryParameters),
m_gasSet(_gasSet),
m_valueSet(_valueSet),
@@ -937,11 +936,11 @@ public:
virtual std::string canonicalName(bool /*_addDataLocation*/) const override;
virtual std::string toString(bool _short) const override;
virtual unsigned calldataEncodedSize(bool _padded) const override;
- virtual bool canBeStored() const override { return m_location == Location::Internal || m_location == Location::External; }
+ virtual bool canBeStored() const override { return m_kind == Kind::Internal || m_kind == Kind::External; }
virtual u256 storageSize() const override;
virtual unsigned storageBytes() const override;
virtual bool isValueType() const override { return true; }
- virtual bool canLiveOutsideStorage() const override { return m_location == Location::Internal || m_location == Location::External; }
+ virtual bool canLiveOutsideStorage() const override { return m_kind == Kind::Internal || m_kind == Kind::External; }
virtual unsigned sizeOnStack() const override;
virtual MemberList::MemberMap nativeMembers(ContractDefinition const* _currentScope) const override;
virtual TypePointer encodingType() const override;
@@ -964,7 +963,7 @@ public:
/// @returns true if the ABI is used for this call (only meaningful for external calls)
bool isBareCall() const;
- Location const& location() const { return m_location; }
+ Kind const& kind() const { return m_kind; }
/// @returns the external signature of this function type given the function name
std::string externalSignature() const;
/// @returns the external identifier of this function (the hash of the signature).
@@ -986,7 +985,7 @@ public:
ASTPointer<ASTString> documentation() const;
/// true iff arguments are to be padded to multiples of 32 bytes for external calls
- bool padArguments() const { return !(m_location == Location::SHA3 || m_location == Location::SHA256 || m_location == Location::RIPEMD160); }
+ bool padArguments() const { return !(m_kind == Kind::SHA3 || m_kind == Kind::SHA256 || m_kind == Kind::RIPEMD160); }
bool takesArbitraryParameters() const { return m_arbitraryParameters; }
bool gasSet() const { return m_gasSet; }
bool valueSet() const { return m_valueSet; }
@@ -1012,7 +1011,7 @@ private:
TypePointers m_returnParameterTypes;
std::vector<std::string> m_parameterNames;
std::vector<std::string> m_returnParameterNames;
- Location const m_location;
+ Kind const m_kind;
/// true if the function takes an arbitrary number of arguments of arbitrary types
bool const m_arbitraryParameters = false;
bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index 42323abd..dc0b340c 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -135,7 +135,7 @@ void CompilerUtils::storeInMemoryDynamic(Type const& _type, bool _padToWordBound
}
else if (
_type.category() == Type::Category::Function &&
- dynamic_cast<FunctionType const&>(_type).location() == FunctionType::Location::External
+ dynamic_cast<FunctionType const&>(_type).kind() == FunctionType::Kind::External
)
{
solUnimplementedAssert(_padToWordBoundaries, "Non-padded store for function not implemented.");
@@ -795,7 +795,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
IntegerType const& targetType = dynamic_cast<IntegerType const&>(_targetType);
solAssert(targetType.isAddress(), "Function type can only be converted to address.");
FunctionType const& typeOnStack = dynamic_cast<FunctionType const&>(_typeOnStack);
- solAssert(typeOnStack.location() == FunctionType::Location::External, "Only external function type can be converted.");
+ solAssert(typeOnStack.kind() == FunctionType::Kind::External, "Only external function type can be converted.");
// stack: <address> <function_id>
m_context << Instruction::POP;
@@ -820,7 +820,7 @@ void CompilerUtils::pushZeroValue(Type const& _type)
{
if (auto const* funType = dynamic_cast<FunctionType const*>(&_type))
{
- if (funType->location() == FunctionType::Location::Internal)
+ if (funType->kind() == FunctionType::Kind::Internal)
{
m_context << m_context.lowLevelFunctionTag("$invalidFunction", 0, 0, [](CompilerContext& _context) {
_context.appendInvalid();
@@ -983,7 +983,7 @@ unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCallda
unsigned numBytes = _type.calldataEncodedSize(_padToWords);
bool isExternalFunctionType = false;
if (auto const* funType = dynamic_cast<FunctionType const*>(&_type))
- if (funType->location() == FunctionType::Location::External)
+ if (funType->kind() == FunctionType::Kind::External)
isExternalFunctionType = true;
if (numBytes == 0)
{
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 744a80c4..f018b311 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -434,7 +434,6 @@ bool ExpressionCompiler::visit(BinaryOperation const& _binaryOperation)
bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
{
CompilerContext::LocationSetter locationSetter(m_context, _functionCall);
- using Location = FunctionType::Location;
if (_functionCall.annotation().isTypeConversion)
{
solAssert(_functionCall.arguments().size() == 1, "");
@@ -499,10 +498,10 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
FunctionType const& function = *functionType;
if (function.bound())
// Only delegatecall and internal functions can be bound, this might be lifted later.
- solAssert(function.location() == Location::DelegateCall || function.location() == Location::Internal, "");
- switch (function.location())
+ solAssert(function.kind() == FunctionType::Kind::DelegateCall || function.kind() == FunctionType::Kind::Internal, "");
+ switch (function.kind())
{
- case Location::Internal:
+ case FunctionType::Kind::Internal:
{
// Calling convention: Caller pushes return address and arguments
// Callee removes them and pushes return values
@@ -538,16 +537,16 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context.adjustStackOffset(returnParametersSize - parameterSize - 1);
break;
}
- case Location::External:
- case Location::CallCode:
- case Location::DelegateCall:
- case Location::Bare:
- case Location::BareCallCode:
- case Location::BareDelegateCall:
+ case FunctionType::Kind::External:
+ case FunctionType::Kind::CallCode:
+ case FunctionType::Kind::DelegateCall:
+ case FunctionType::Kind::Bare:
+ case FunctionType::Kind::BareCallCode:
+ case FunctionType::Kind::BareDelegateCall:
_functionCall.expression().accept(*this);
appendExternalFunctionCall(function, arguments);
break;
- case Location::Creation:
+ case FunctionType::Kind::Creation:
{
_functionCall.expression().accept(*this);
solAssert(!function.gasSet(), "Gas limit set for contract creation.");
@@ -592,7 +591,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << swapInstruction(1) << Instruction::POP;
break;
}
- case Location::SetGas:
+ case FunctionType::Kind::SetGas:
{
// stack layout: contract_address function_id [gas] [value]
_functionCall.expression().accept(*this);
@@ -608,7 +607,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << Instruction::POP;
break;
}
- case Location::SetValue:
+ case FunctionType::Kind::SetValue:
// stack layout: contract_address function_id [gas] [value]
_functionCall.expression().accept(*this);
// Note that function is not the original function, but the ".value" function.
@@ -617,8 +616,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << Instruction::POP;
arguments.front()->accept(*this);
break;
- case Location::Send:
- case Location::Transfer:
+ case FunctionType::Kind::Send:
+ case FunctionType::Kind::Transfer:
_functionCall.expression().accept(*this);
// Provide the gas stipend manually at first because we may send zero ether.
// Will be zeroed if we send more than zero ether.
@@ -637,7 +636,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
TypePointers{},
strings(),
strings(),
- Location::Bare,
+ FunctionType::Kind::Bare,
false,
nullptr,
false,
@@ -647,24 +646,24 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
),
{}
);
- if (function.location() == Location::Transfer)
+ if (function.kind() == FunctionType::Kind::Transfer)
{
// Check if zero (out of stack or not enough balance).
m_context << Instruction::ISZERO;
m_context.appendConditionalInvalid();
}
break;
- case Location::Selfdestruct:
+ case FunctionType::Kind::Selfdestruct:
arguments.front()->accept(*this);
utils().convertType(*arguments.front()->annotation().type, *function.parameterTypes().front(), true);
m_context << Instruction::SELFDESTRUCT;
break;
- case Location::Revert:
+ case FunctionType::Kind::Revert:
// memory offset returned - zero length
m_context << u256(0) << u256(0);
m_context << Instruction::REVERT;
break;
- case Location::SHA3:
+ case FunctionType::Kind::SHA3:
{
TypePointers argumentTypes;
for (auto const& arg: arguments)
@@ -678,13 +677,13 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << Instruction::SHA3;
break;
}
- case Location::Log0:
- case Location::Log1:
- case Location::Log2:
- case Location::Log3:
- case Location::Log4:
+ case FunctionType::Kind::Log0:
+ case FunctionType::Kind::Log1:
+ case FunctionType::Kind::Log2:
+ case FunctionType::Kind::Log3:
+ case FunctionType::Kind::Log4:
{
- unsigned logNumber = int(function.location()) - int(Location::Log0);
+ unsigned logNumber = int(function.kind()) - int(FunctionType::Kind::Log0);
for (unsigned arg = logNumber; arg > 0; --arg)
{
arguments[arg]->accept(*this);
@@ -701,7 +700,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << logInstruction(logNumber);
break;
}
- case Location::Event:
+ case FunctionType::Kind::Event:
{
_functionCall.expression().accept(*this);
auto const& event = dynamic_cast<EventDefinition const&>(function.declaration());
@@ -755,50 +754,50 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << logInstruction(numIndexed);
break;
}
- case Location::BlockHash:
+ case FunctionType::Kind::BlockHash:
{
arguments[0]->accept(*this);
utils().convertType(*arguments[0]->annotation().type, *function.parameterTypes()[0], true);
m_context << Instruction::BLOCKHASH;
break;
}
- case Location::AddMod:
- case Location::MulMod:
+ case FunctionType::Kind::AddMod:
+ case FunctionType::Kind::MulMod:
{
for (unsigned i = 0; i < 3; i ++)
{
arguments[2 - i]->accept(*this);
utils().convertType(*arguments[2 - i]->annotation().type, IntegerType(256));
}
- if (function.location() == Location::AddMod)
+ if (function.kind() == FunctionType::Kind::AddMod)
m_context << Instruction::ADDMOD;
else
m_context << Instruction::MULMOD;
break;
}
- case Location::ECRecover:
- case Location::SHA256:
- case Location::RIPEMD160:
+ case FunctionType::Kind::ECRecover:
+ case FunctionType::Kind::SHA256:
+ case FunctionType::Kind::RIPEMD160:
{
_functionCall.expression().accept(*this);
- static const map<Location, u256> contractAddresses{{Location::ECRecover, 1},
- {Location::SHA256, 2},
- {Location::RIPEMD160, 3}};
- m_context << contractAddresses.find(function.location())->second;
+ static const map<FunctionType::Kind, u256> contractAddresses{{FunctionType::Kind::ECRecover, 1},
+ {FunctionType::Kind::SHA256, 2},
+ {FunctionType::Kind::RIPEMD160, 3}};
+ m_context << contractAddresses.find(function.kind())->second;
for (unsigned i = function.sizeOnStack(); i > 0; --i)
m_context << swapInstruction(i);
appendExternalFunctionCall(function, arguments);
break;
}
- case Location::ByteArrayPush:
- case Location::ArrayPush:
+ case FunctionType::Kind::ByteArrayPush:
+ case FunctionType::Kind::ArrayPush:
{
_functionCall.expression().accept(*this);
solAssert(function.parameterTypes().size() == 1, "");
solAssert(!!function.parameterTypes()[0], "");
TypePointer paramType = function.parameterTypes()[0];
shared_ptr<ArrayType> arrayType =
- function.location() == Location::ArrayPush ?
+ function.kind() == FunctionType::Kind::ArrayPush ?
make_shared<ArrayType>(DataLocation::Storage, paramType) :
make_shared<ArrayType>(DataLocation::Storage);
// get the current length
@@ -822,13 +821,13 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
utils().moveToStackTop(1 + type->sizeOnStack());
utils().moveToStackTop(1 + type->sizeOnStack());
// stack: newLength argValue storageSlot slotOffset
- if (function.location() == Location::ArrayPush)
+ if (function.kind() == FunctionType::Kind::ArrayPush)
StorageItem(m_context, *paramType).storeValue(*type, _functionCall.location(), true);
else
StorageByteArrayElement(m_context).storeValue(*type, _functionCall.location(), true);
break;
}
- case Location::ObjectCreation:
+ case FunctionType::Kind::ObjectCreation:
{
// Will allocate at the end of memory (MSIZE) and not write at all unless the base
// type is dynamically sized.
@@ -878,15 +877,15 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << Instruction::POP;
break;
}
- case Location::Assert:
- case Location::Require:
+ case FunctionType::Kind::Assert:
+ case FunctionType::Kind::Require:
{
arguments.front()->accept(*this);
utils().convertType(*arguments.front()->annotation().type, *function.parameterTypes().front(), false);
// jump if condition was met
m_context << Instruction::ISZERO << Instruction::ISZERO;
auto success = m_context.appendConditionalJump();
- if (function.location() == Location::Assert)
+ if (function.kind() == FunctionType::Kind::Assert)
// condition was not met, flag an error
m_context << Instruction::INVALID;
else
@@ -922,7 +921,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
*funType->selfType(),
true
);
- if (funType->location() == FunctionType::Location::Internal)
+ if (funType->kind() == FunctionType::Kind::Internal)
{
FunctionDefinition const& funDef = dynamic_cast<decltype(funDef)>(funType->declaration());
utils().pushCombinedFunctionEntryLabel(funDef);
@@ -930,7 +929,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
}
else
{
- solAssert(funType->location() == FunctionType::Location::DelegateCall, "");
+ solAssert(funType->kind() == FunctionType::Kind::DelegateCall, "");
auto contract = dynamic_cast<ContractDefinition const*>(funType->declaration().scope());
solAssert(contract && contract->isLibrary(), "");
m_context.appendLibraryAddress(contract->fullyQualifiedName());
@@ -949,9 +948,9 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
solAssert(_memberAccess.annotation().type, "_memberAccess has no type");
if (auto funType = dynamic_cast<FunctionType const*>(_memberAccess.annotation().type.get()))
{
- switch (funType->location())
+ switch (funType->kind())
{
- case FunctionType::Location::Internal:
+ case FunctionType::Kind::Internal:
// We do not visit the expression here on purpose, because in the case of an
// internal library function call, this would push the library address forcing
// us to link against it although we actually do not need it.
@@ -960,31 +959,31 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
else
solAssert(false, "Function not found in member access");
break;
- case FunctionType::Location::Event:
+ case FunctionType::Kind::Event:
if (!dynamic_cast<EventDefinition const*>(_memberAccess.annotation().referencedDeclaration))
solAssert(false, "event not found");
// no-op, because the parent node will do the job
break;
- case FunctionType::Location::External:
- case FunctionType::Location::Creation:
- case FunctionType::Location::DelegateCall:
- case FunctionType::Location::CallCode:
- case FunctionType::Location::Send:
- case FunctionType::Location::Bare:
- case FunctionType::Location::BareCallCode:
- case FunctionType::Location::BareDelegateCall:
- case FunctionType::Location::Transfer:
+ case FunctionType::Kind::External:
+ case FunctionType::Kind::Creation:
+ case FunctionType::Kind::DelegateCall:
+ case FunctionType::Kind::CallCode:
+ case FunctionType::Kind::Send:
+ case FunctionType::Kind::Bare:
+ case FunctionType::Kind::BareCallCode:
+ case FunctionType::Kind::BareDelegateCall:
+ case FunctionType::Kind::Transfer:
_memberAccess.expression().accept(*this);
m_context << funType->externalIdentifier();
break;
- case FunctionType::Location::Log0:
- case FunctionType::Location::Log1:
- case FunctionType::Location::Log2:
- case FunctionType::Location::Log3:
- case FunctionType::Location::Log4:
- case FunctionType::Location::ECRecover:
- case FunctionType::Location::SHA256:
- case FunctionType::Location::RIPEMD160:
+ case FunctionType::Kind::Log0:
+ case FunctionType::Kind::Log1:
+ case FunctionType::Kind::Log2:
+ case FunctionType::Kind::Log3:
+ case FunctionType::Kind::Log4:
+ case FunctionType::Kind::ECRecover:
+ case FunctionType::Kind::SHA256:
+ case FunctionType::Kind::RIPEMD160:
default:
solAssert(false, "unsupported member function");
}
@@ -1372,7 +1371,7 @@ void ExpressionCompiler::appendCompareOperatorCode(Token::Value _operator, Type
{
if (FunctionType const* funType = dynamic_cast<decltype(funType)>(&_type))
{
- if (funType->location() == FunctionType::Location::Internal)
+ if (funType->kind() == FunctionType::Kind::Internal)
{
// We have to remove the upper bits (construction time value) because they might
// be "unknown" in one of the operands and not in the other.
@@ -1555,11 +1554,10 @@ void ExpressionCompiler::appendExternalFunctionCall(
if (_functionType.bound())
utils().moveToStackTop(gasValueSize, _functionType.selfType()->sizeOnStack());
- using FunctionKind = FunctionType::Location;
- FunctionKind funKind = _functionType.location();
- bool returnSuccessCondition = funKind == FunctionKind::Bare || funKind == FunctionKind::BareCallCode;
- bool isCallCode = funKind == FunctionKind::BareCallCode || funKind == FunctionKind::CallCode;
- bool isDelegateCall = funKind == FunctionKind::BareDelegateCall || funKind == FunctionKind::DelegateCall;
+ auto funKind = _functionType.kind();
+ bool returnSuccessCondition = funKind == FunctionType::Kind::Bare || funKind == FunctionType::Kind::BareCallCode;
+ bool isCallCode = funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::CallCode;
+ bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall;
unsigned retSize = 0;
if (returnSuccessCondition)
@@ -1576,7 +1574,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
TypePointers parameterTypes = _functionType.parameterTypes();
bool manualFunctionId = false;
if (
- (funKind == FunctionKind::Bare || funKind == FunctionKind::BareCallCode || funKind == FunctionKind::BareDelegateCall) &&
+ (funKind == FunctionType::Kind::Bare || funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::BareDelegateCall) &&
!_arguments.empty()
)
{
@@ -1611,7 +1609,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
argumentTypes.push_back(_arguments[i]->annotation().type);
}
- if (funKind == FunctionKind::ECRecover)
+ if (funKind == FunctionType::Kind::ECRecover)
{
// Clears 32 bytes of currently free memory and advances free memory pointer.
// Output area will be "start of input area" - 32.
@@ -1667,7 +1665,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
// put on stack: <size of output> <memory pos of output> <size of input> <memory pos of input>
m_context << u256(retSize);
utils().fetchFreeMemoryPointer(); // This is the start of input
- if (funKind == FunctionKind::ECRecover)
+ if (funKind == FunctionType::Kind::ECRecover)
{
// In this case, output is 32 bytes before input and has already been cleared.
m_context << u256(32) << Instruction::DUP2 << Instruction::SUB << Instruction::SWAP1;
@@ -1693,7 +1691,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
bool existenceChecked = false;
// Check the the target contract exists (has code) for non-low-level calls.
- if (funKind == FunctionKind::External || funKind == FunctionKind::CallCode || funKind == FunctionKind::DelegateCall)
+ if (funKind == FunctionType::Kind::External || funKind == FunctionType::Kind::CallCode || funKind == FunctionType::Kind::DelegateCall)
{
m_context << Instruction::DUP1 << Instruction::EXTCODESIZE << Instruction::ISZERO;
m_context.appendConditionalInvalid();
@@ -1741,14 +1739,14 @@ void ExpressionCompiler::appendExternalFunctionCall(
{
// already there
}
- else if (funKind == FunctionKind::RIPEMD160)
+ else if (funKind == FunctionType::Kind::RIPEMD160)
{
// fix: built-in contract returns right-aligned data
utils().fetchFreeMemoryPointer();
utils().loadFromMemoryDynamic(IntegerType(160), false, true, false);
utils().convertType(IntegerType(160), FixedBytesType(20));
}
- else if (funKind == FunctionKind::ECRecover)
+ else if (funKind == FunctionType::Kind::ECRecover)
{
// Output is 32 bytes before input / free mem pointer.
// Failing ecrecover cannot be detected, so we clear output before the call.
diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp
index b9e141d8..a74a3d74 100644
--- a/libsolidity/codegen/LValue.cpp
+++ b/libsolidity/codegen/LValue.cpp
@@ -199,7 +199,7 @@ void StorageItem::retrieveValue(SourceLocation const&, bool _remove) const
}
else if (FunctionType const* fun = dynamic_cast<decltype(fun)>(m_dataType))
{
- if (fun->location() == FunctionType::Location::External)
+ if (fun->kind() == FunctionType::Kind::External)
{
CompilerUtils(m_context).splitExternalFunctionType(false);
cleaned = true;
@@ -256,7 +256,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
if (FunctionType const* fun = dynamic_cast<decltype(fun)>(m_dataType))
{
solAssert(_sourceType == *m_dataType, "function item stored but target is not equal to source");
- if (fun->location() == FunctionType::Location::External)
+ if (fun->kind() == FunctionType::Kind::External)
// Combine the two-item function type into a single stack slot.
utils.combineExternalFunctionType(false);
else
diff --git a/libsolidity/formal/Why3Translator.cpp b/libsolidity/formal/Why3Translator.cpp
index 2903a4e3..b6f17907 100644
--- a/libsolidity/formal/Why3Translator.cpp
+++ b/libsolidity/formal/Why3Translator.cpp
@@ -588,14 +588,14 @@ bool Why3Translator::visit(FunctionCall const& _node)
return true;
}
FunctionType const& function = dynamic_cast<FunctionType const&>(*_node.expression().annotation().type);
- switch (function.location())
+ switch (function.kind())
{
- case FunctionType::Location::AddMod:
- case FunctionType::Location::MulMod:
+ case FunctionType::Kind::AddMod:
+ case FunctionType::Kind::MulMod:
{
//@todo require that third parameter is not zero
add("(of_int (mod (Int.(");
- add(function.location() == FunctionType::Location::AddMod ? "+" : "*");
+ add(function.kind() == FunctionType::Kind::AddMod ? "+" : "*");
add(") (to_int ");
_node.arguments().at(0)->accept(*this);
add(") (to_int ");
@@ -605,7 +605,7 @@ bool Why3Translator::visit(FunctionCall const& _node)
add(")))");
return false;
}
- case FunctionType::Location::Internal:
+ case FunctionType::Kind::Internal:
{
if (!_node.names().empty())
{
@@ -626,7 +626,7 @@ bool Why3Translator::visit(FunctionCall const& _node)
add(")");
return false;
}
- case FunctionType::Location::Bare:
+ case FunctionType::Kind::Bare:
{
if (!_node.arguments().empty())
{
@@ -654,7 +654,7 @@ bool Why3Translator::visit(FunctionCall const& _node)
add(")");
return false;
}
- case FunctionType::Location::SetValue:
+ case FunctionType::Kind::SetValue:
{
add("let amount = ");
solAssert(_node.arguments().size() == 1, "");
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 6b0024ad..effc8309 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -527,13 +527,13 @@ StringMap CompilerStack::loadMissingSources(SourceUnit const& _ast, std::string
result = m_readFile(importPath);
if (result.success)
- newSources[importPath] = result.contentsOrErrorMesage;
+ newSources[importPath] = result.contentsOrErrorMessage;
else
{
auto err = make_shared<Error>(Error::Type::ParserError);
*err <<
errinfo_sourceLocation(import->location()) <<
- errinfo_comment("Source \"" + importPath + "\" not found: " + result.contentsOrErrorMesage);
+ errinfo_comment("Source \"" + importPath + "\" not found: " + result.contentsOrErrorMessage);
m_errors.push_back(std::move(err));
continue;
}
diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h
index eddfea68..65850683 100644
--- a/libsolidity/interface/CompilerStack.h
+++ b/libsolidity/interface/CompilerStack.h
@@ -80,7 +80,7 @@ public:
struct ReadFileResult
{
bool success;
- std::string contentsOrErrorMesage;
+ std::string contentsOrErrorMessage;
};
/// File reading callback.
diff --git a/prerelease.txt b/prerelease.txt
deleted file mode 100644
index e69de29b..00000000
--- a/prerelease.txt
+++ /dev/null
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index ad448fd3..c984ce99 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -14,3 +14,5 @@ make solc && install -s solc/solc /usr/bin &&\
cd / && rm -rf solidity &&\
apk del sed build-base git make cmake gcc g++ musl-dev curl-dev boost-dev &&\
rm -rf /var/cache/apk/*
+
+ENTRYPOINT ["/usr/bin/solc"] \ No newline at end of file
diff --git a/scripts/docker_deploy.sh b/scripts/docker_deploy.sh
index d2810a3e..0abde840 100755
--- a/scripts/docker_deploy.sh
+++ b/scripts/docker_deploy.sh
@@ -10,13 +10,11 @@ then
docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT"
docker push ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT";
docker push ethereum/solc:nightly;
-elif [ "$TRAVIS_BRANCH" = "release" ]
-then
- docker tag ethereum/solc:build ethereum/solc:stable;
- docker push ethereum/solc:stable;
elif [ "$TRAVIS_TAG" = v"$version" ]
then
+ docker tag ethereum/solc:build ethereum/solc:stable;
docker tag ethereum/solc:build ethereum/solc:"$version";
+ docker push ethereum/solc:stable;
docker push ethereum/solc:"$version";
else
echo "Not publishing docker image from branch $TRAVIS_BRANCH or tag $TRAVIS_TAG"
diff --git a/scripts/isolate_tests.py b/scripts/isolate_tests.py
index 91900aa6..9bb52f4c 100755
--- a/scripts/isolate_tests.py
+++ b/scripts/isolate_tests.py
@@ -7,23 +7,27 @@
# scripts/isolate_tests.py test/libsolidity/*
import sys
+import re
def extract_cases(path):
lines = open(path).read().splitlines()
inside = False
+ delimiter = ''
tests = []
for l in lines:
if inside:
- if l.strip().endswith(')";'):
+ if l.strip().endswith(')' + delimiter + '";'):
inside = False
else:
tests[-1] += l + '\n'
else:
- if l.strip().endswith('R"('):
+ m = re.search(r'R"([^(]*)\($', l.strip())
+ if m:
inside = True
+ delimiter = m.group(1)
tests += ['']
return tests
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index 6ebd1a55..45322117 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -143,18 +143,18 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
if (!contents_c && !error_c)
{
result.success = false;
- result.contentsOrErrorMesage = "File not found.";
+ result.contentsOrErrorMessage = "File not found.";
}
if (contents_c)
{
result.success = true;
- result.contentsOrErrorMesage = string(contents_c);
+ result.contentsOrErrorMessage = string(contents_c);
free(contents_c);
}
if (error_c)
{
result.success = false;
- result.contentsOrErrorMesage = string(error_c);
+ result.contentsOrErrorMessage = string(error_c);
free(error_c);
}
return result;
diff --git a/test/libsolidity/SolidityTypes.cpp b/test/libsolidity/SolidityTypes.cpp
index 2dcb9226..5362239d 100644
--- a/test/libsolidity/SolidityTypes.cpp
+++ b/test/libsolidity/SolidityTypes.cpp
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(type_identifiers)
TupleType t({e.type(), s.type(), stringArray, nullptr});
BOOST_CHECK_EQUAL(t.identifier(), "t_tuple$_t_type$_t_enum$_Enum_$4_$_$_t_type$_t_struct$_Struct_$3_storage_ptr_$_$_t_array$_t_string_storage_$20_storage_ptr_$__$");
- TypePointer sha3fun = make_shared<FunctionType>(strings{}, strings{}, FunctionType::Location::SHA3);
+ TypePointer sha3fun = make_shared<FunctionType>(strings{}, strings{}, FunctionType::Kind::SHA3);
BOOST_CHECK_EQUAL(sha3fun->identifier(), "t_function_sha3$__$returns$__$");
FunctionType metaFun(TypePointers{sha3fun}, TypePointers{s.type()});