diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index e654dd575..e146318c8 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -347,7 +347,7 @@ void ExpressionStatement::checkTypeRequirements() void Expression::expectType(Type const& _expectedType) { checkTypeRequirements(); - const Type& type = *getType(); + Type const& type = *getType(); if (!type.isImplicitlyConvertibleTo(_expectedType)) BOOST_THROW_EXCEPTION(createTypeError("Type " + type.toString() + " not implicitly convertible to expected type " diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index da054920d..48bcd578d 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -376,8 +376,7 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con else if (_typeOnStack != _targetType) { // All other types should not be convertible to non-equal types. - assert(!_typeOnStack.isExplicitlyConvertibleTo(_targetType)); - assert(false); + BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid type conversion requested.")); } }