Created
February 28, 2024 05:50
-
-
Save bshastry/c5044583d96ea45082e7a3942cbe2171 to your computer and use it in GitHub Desktop.
Experimental via IR ICE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma experimental solidity; | |
type uint256 = __builtin("word"); | |
instantiation uint256: + { | |
function add(x, y) -> uint256 { | |
let a = uint256.rep(x); | |
let b = uint256.rep(y); | |
assembly { | |
a := add(a,b) | |
} | |
return uint256.abs(a); | |
} | |
} | |
function unreferenced(x:uint256) -> uint256 | |
{ | |
return x; | |
} | |
function f(x:uint256) -> uint256 | |
{ | |
return g(h(x)); | |
} | |
function g(x:uint256) -> uint256 | |
{ | |
return x; | |
} | |
function h(x:uint256) -> uint256 | |
{ | |
return x; | |
} | |
contract C { | |
fallback() external { | |
let a: uint256->uint256 = f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment