From e3accc6aa6857c8ae7c6f075ff50d9a17989cd0d Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Mon, 3 Dec 2018 17:59:21 +0100 Subject: Simplifies Result and prevents undefined behaviour. --- libsolidity/ast/Types.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libsolidity') 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()); + return TypeResult{make_shared()}; // 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 -- cgit