mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Re-added some changes lost in merges.
This commit is contained in:
parent
e0ba1c79db
commit
d3215fb4a6
2
AST.cpp
2
AST.cpp
@ -347,7 +347,7 @@ void ExpressionStatement::checkTypeRequirements()
|
|||||||
void Expression::expectType(Type const& _expectedType)
|
void Expression::expectType(Type const& _expectedType)
|
||||||
{
|
{
|
||||||
checkTypeRequirements();
|
checkTypeRequirements();
|
||||||
const Type& type = *getType();
|
Type const& type = *getType();
|
||||||
if (!type.isImplicitlyConvertibleTo(_expectedType))
|
if (!type.isImplicitlyConvertibleTo(_expectedType))
|
||||||
BOOST_THROW_EXCEPTION(createTypeError("Type " + type.toString() +
|
BOOST_THROW_EXCEPTION(createTypeError("Type " + type.toString() +
|
||||||
" not implicitly convertible to expected type "
|
" not implicitly convertible to expected type "
|
||||||
|
@ -376,8 +376,7 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con
|
|||||||
else if (_typeOnStack != _targetType)
|
else if (_typeOnStack != _targetType)
|
||||||
{
|
{
|
||||||
// All other types should not be convertible to non-equal types.
|
// All other types should not be convertible to non-equal types.
|
||||||
assert(!_typeOnStack.isExplicitlyConvertibleTo(_targetType));
|
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid type conversion requested."));
|
||||||
assert(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user