SC0201 type mismatch: expected uint256, found uint256
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- solidity
- Domain
- compilers
Research direction
Start in crates/hir-ty/src/infer/expr.rs, reading infer_direct_call() and infer_indirect_call() alongside the reported getBalance() reproducer. Check how expected and actual return types are reversed and how the expected label is overwritten. Done means the compiler reports “expected uint256, found word” rather than “expected uint256, found uint256”.
Written by the indexing model from the issue text.
Description
Compiling the following function:
public function getBalance() -> uint256 {
return selfbalance();
}
results in the following compile error:
SC0201 type mismatch: expected uint256, found uint256
The reason seems to be: The call checker reverses expected and actual return types, then overwrites only the expected label,
producing “expected uint256, found uint256” instead of “expected uint256, found word.”
Location: most likely infer_direct_call() and infer_indirect_call() in expr.rs.
- Dominant language
- Haskell
- Stars
- 113
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from argotorg/solcore
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in argotorg/solcore
Similar issues
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
koalaman/shellcheck#3539 ·
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100