Skip to content

Assembly builtins share the namespace with solc symbols #426

@axic

Description

@axic
function keccak256(input: memory(bytes)) -> bytes32 {
    let ptr : word = Typedef.rep(input);
    let res : word;
    assembly {
        res := keccak256(add(ptr, 32), mload(ptr))
    }
    return bytes32(res);
}

Results in:

Type error:
Arity mismatch in call to keccak256
  expected 1 argument(s)
  found    2

Error: yule generation failed

So assembly builtins/functions are in the same namespace as solc symbols? Yet they are not accessible there (and only local solc non-functions are available in yul), so I would assume this should not be the case (and is not in solidity). I'd argue that may not be optimal.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions