Return TypeError is fixed point encoding is attempted.

This commit is contained in:
Leonardo Alt 2019-01-17 13:36:06 +01:00
parent d8f663429f
commit c96b760c47
2 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Compiler Features:
Bugfixes: Bugfixes:
* TypeChecker: Return type error if fixed point encoding is attempted instead of throwing ``UnimplementedFeatureError``.
* Yul: Check that arguments to ``dataoffset`` and ``datasize`` are literals at parse time and properly take this into account in the optimizer. * Yul: Check that arguments to ``dataoffset`` and ``datasize`` are literals at parse time and properly take this into account in the optimizer.
* Yul: Parse number literals for detecting duplicate switch cases. * Yul: Parse number literals for detecting duplicate switch cases.
* Yul: Require switch cases to have the same type. * Yul: Require switch cases to have the same type.

View File

@ -1482,7 +1482,16 @@ void TypeChecker::typeCheckABIEncodeFunctions(
if (argType->category() == Type::Category::RationalNumber) 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( m_errorReporter.typeError(
arguments[i]->location(), arguments[i]->location(),