Open d-xo opened 1 month ago
The following fails:
data Memory(t) = Memory(word); data Bytes = Bytes; function get_bytes() -> Memory(Bytes) { let ptr : word; assembly { ptr := mload(0x40) }; return Memory(ptr); }
with:
Types do not match: Bytes and b - in:function get_bytes () -> Memory(Bytes) { let ptr :: word ; assembly { { ptr := mload(64) } } return Memory(ptr) }
If I insert an intermediate variable with a type annotation, then typechecking passes:
data Memory(t) = Memory(word); data Bytes = Bytes; function get_bytes() -> Memory(Bytes) { let ptr : word; assembly { ptr := mload(0x40) }; let mem : Memory(Bytes) = Memory(ptr); return mem; }
The following fails:
with:
If I insert an intermediate variable with a type annotation, then typechecking passes: