You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(slang): emit sol.this for ThisKeyword expressions (#369)
Adds a `ThisKeyword` match arm in the expression emitter so Solidity
`this` lowers to `sol.this` with the enclosing contract's
`!sol.contract<...>` type. Mirrors the reference pattern in
`solx-solidity/libsolidity/codegen/mlir/SolidityToMLIR.cpp:611-616`. The
contract type is stashed on `Context::current_contract_type` by the
contract emitter, scoped per-function, so the expression layer reads it
directly instead of threading the contract name through every emitter.
Foundational for later work on external calls (`this.f()`),
`address(this).balance`, `payable(this)`, and related patterns — does
not flip any test to PASSED on its own because the tests that exercise
`this` also require features still not yet supported (external calls,
inline assembly). Regression checked: identical pass/fail counts against
`tests/solidity/simple` with and without this change.
`payable` is derived from the contract's `receive` / payable `fallback`
functions, matching `ContractType(*currContract).isPayable()` in the
reference compiler.
0 commit comments