Library function can be used as user operator

This commit is contained in:
wechman
2022-09-28 13:06:25 +02:00
parent 7d12eb5745
commit e8243d49bc
3 changed files with 43 additions and 4 deletions
@@ -679,7 +679,7 @@ bool IRGeneratorForStatements::visit(UnaryOperation const& _unaryOperation)
setLocation(_unaryOperation);
solAssert(
dynamic_cast<SourceUnit const*>(function->scope()),
function->isFree() || function->libraryFunction(),
"Only file-level functions and library functions can be bound to a user type operator."
);
@@ -824,7 +824,7 @@ bool IRGeneratorForStatements::visit(BinaryOperation const& _binOp)
setLocation(_binOp);
solAssert(
dynamic_cast<SourceUnit const*>(function->scope()),
function->isFree() || function->libraryFunction(),
"Only file-level functions and library functions can be bound to a user type operator."
);