Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Compiler incorrectly interprets parameter names #196

Open
Philogy opened this issue Aug 5, 2022 · 0 comments · Fixed by #204
Open

Compiler incorrectly interprets parameter names #196

Philogy opened this issue Aug 5, 2022 · 0 comments · Fixed by #204

Comments

@Philogy
Copy link
Contributor

Philogy commented Aug 5, 2022

Expected behavior

1.1 Naming parameters as native solidity datatypes should lead to an error
1.2 A lack of a comma in a function definition should not lead to following datatypes affecting the function signature
2. You should be allowed to give a parameter a name that starts with "int" / "uint" / "bytes"
3. You should be able to name dynamic parameters (string, bytes, <type>[], etc.)

Currently observed behavior

Version: 0.3.0 (Note issues also observed under 0.2.0)

1.1 #define function balanceOf(address uint256) view returns (uint256 balance) => no error
1.2 #define function balanceOf(address uint256) view returns (uint256 balance) //; ... __FUNC_SIG(balanceOf) => returns signature for "balanceOf(address,uint256)"
2. #define function supportsInterface(bytes4 interfaceId) view returns (bool) => produces compiler error:

⠋ Compiling...thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', huff_utils/src/types.rs:47:49
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    122499 IOT instruction (core dumped)  huffc src/ERC721H.huff -b
  1. #define function transferMany(uint256[] memory tokens) view returns () => produces compiler error:
⠙ Compiling...

Error: Invalid Argument Type: "tokens"
-> src/ERC721H.huff:858-864
       |
  > 16 | #define function transferMany(uint256[] memory tokens) view returns ()
       |

@refcell refcell linked a pull request Aug 25, 2022 that will close this issue
4 tasks
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant