aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-12-04 00:59:21 +0800
committerErik Kundt <bitshift@posteo.org>2018-12-05 17:33:34 +0800
commite3accc6aa6857c8ae7c6f075ff50d9a17989cd0d (patch)
tree61f195edac6d80164098f98b3ec0aa640c59b388 /libsolidity/ast
parent05e74d096ed5a891ae2c1c0d916727ebaca1109f (diff)
downloaddexon-solidity-e3accc6aa6857c8ae7c6f075ff50d9a17989cd0d.tar.gz
dexon-solidity-e3accc6aa6857c8ae7c6f075ff50d9a17989cd0d.tar.zst
dexon-solidity-e3accc6aa6857c8ae7c6f075ff50d9a17989cd0d.zip
Simplifies Result<T> and prevents undefined behaviour.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index f67d0b12..c6b4211a 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -611,14 +611,14 @@ TypeResult IntegerType::unaryOperatorResult(Token _operator) const
{
// "delete" is ok for all integer types
if (_operator == Token::Delete)
- return TypeResult::Ok(make_shared<TupleType>());
+ return TypeResult{make_shared<TupleType>()};
// we allow +, -, ++ and --
else if (_operator == Token::Add || _operator == Token::Sub ||
_operator == Token::Inc || _operator == Token::Dec ||
_operator == Token::BitNot)
- return TypeResult::Ok(shared_from_this());
+ return TypeResult{shared_from_this()};
else
- return TypeResult::Err();
+ return TypeResult{""};
}
bool IntegerType::operator==(Type const& _other) const