diff options
author | Erik Kundt <bitshift@posteo.org> | 2018-12-04 00:59:21 +0800 |
---|---|---|
committer | Erik Kundt <bitshift@posteo.org> | 2018-12-05 17:33:34 +0800 |
commit | e3accc6aa6857c8ae7c6f075ff50d9a17989cd0d (patch) | |
tree | 61f195edac6d80164098f98b3ec0aa640c59b388 /libsolidity/ast | |
parent | 05e74d096ed5a891ae2c1c0d916727ebaca1109f (diff) | |
download | dexon-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.cpp | 6 |
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 |