mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add minimal support for fixed-point types in assembly.
This commit is contained in:
parent
fe29385dc7
commit
7b8279966e
@ -806,8 +806,6 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
|
||||
}
|
||||
}
|
||||
|
||||
solAssert(!dynamic_cast<FixedPointType const*>(var->type()), "FixedPointType not implemented.");
|
||||
|
||||
if (!identifierInfo.suffix.empty())
|
||||
{
|
||||
string const& suffix = identifierInfo.suffix;
|
||||
|
@ -3741,7 +3741,7 @@ string YulUtilFunctions::cleanupFunction(Type const& _type)
|
||||
templ("body", "cleaned := iszero(iszero(value))");
|
||||
break;
|
||||
case Type::Category::FixedPoint:
|
||||
solUnimplemented("Fixed point types not implemented.");
|
||||
templ("body", "cleaned := " + cleanupFunction(*dynamic_cast<FixedPointType const&>(_type).asIntegerType()) + "(value)");
|
||||
break;
|
||||
case Type::Category::Function:
|
||||
switch (dynamic_cast<FunctionType const&>(_type).kind())
|
||||
|
@ -0,0 +1,10 @@
|
||||
contract A {
|
||||
function f() public pure returns (fixed x) {
|
||||
assembly { x := 1000 }
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileToEwasm: also
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 1000
|
Loading…
Reference in New Issue
Block a user