Return TypeError is fixed point encoding is attempted.

This commit is contained in:
Leonardo Alt
2019-01-17 13:36:53 +01:00
parent d8f663429f
commit c96b760c47
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -1482,7 +1482,16 @@ void TypeChecker::typeCheckABIEncodeFunctions(
if (argType->category() == Type::Category::RationalNumber)
{
if (!argType->mobileType())
auto const& rationalType = dynamic_cast<RationalNumberType const&>(*argType);
if (rationalType.isFractional())
{
m_errorReporter.typeError(
arguments[i]->location(),
"Fixed point numbers cannot yet be encoded."
);
continue;
}
else if (!argType->mobileType())
{
m_errorReporter.typeError(
arguments[i]->location(),