Skip to content

fix: resolve ambiguous console.log overload for uint8 - #679

Open
Alicepoltora wants to merge 2 commits into
circlefin:masterfrom
Alicepoltora:fix/console-log-ambiguous-overload
Open

Alicepoltora wants to merge 2 commits into
circlefin:masterfrom
Alicepoltora:fix/console-log-ambiguous-overload

Conversation

@Alicepoltora

@Alicepoltora Alicepoltora commented Sep 8, 2026 •

Copy link
Copy Markdown

Summary

Fixes #564

Problem

console.log("FEE_ADAPTER_DECIMALS: '%s'", feeAdapterDecimals) where feeAdapterDecimals is uint8 causes an ambiguous overload compilation error (Member "log" not unique after argument-dependent lookup) with forge-std versions that declare both (string, uint256) and (string, int256) overloads (e.g. v1.9.1, v1.9.2): uint8 implicitly converts to both, so overload resolution fails.

Fix

Cast the uint8 values to uint256 explicitly so the (string, uint256) overload resolves uniquely:

Verification

  • forge build and forge test pass with the pinned forge-std (v1.7.6)
  • forge build fails with Error (6675) before this change and passes after it when using forge-std v1.9.1
  • yarn compile, yarn static-check, yarn fmt:check pass

Foundry's console.log has overloads for (string, uint256) but not
(string, uint8). Passing a uint8 value causes an ambiguous overload
compilation error. Cast feeAdapterDecimals to uint256 explicitly.

Fixes circlefin#564
The same ambiguous console.log overload reported in circlefin#564 also affects
the TOKEN_DECIMALS logging in deploy-fiat-token.s.sol and
deploy-fiat-token-celo.s.sol, where tokenDecimals is uint8. Cast to
uint256 explicitly so the (string, uint256) overload resolves uniquely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants