The Soroban-only builtin method extendTtl (declared with target: vec![Target::Soroban] in src/sema/builtin.rs) is accepted by sema on every target because BUILTIN_METHODS resolution at src/sema/builtin.rs:1446 filters only by name and receiver type, not by func.target (the sibling function-call resolver at L899 does check).
MRE:
contract C {
uint64 public persistent pCount = 11;
function f() public view returns (int64) {
return pCount.extendTtl(1000, 5000);
}
}
Reproduce: save as mre.sol, run solang compile --target solana mre.sol.
Output:
thread 'main' panicked at src/codegen/expression.rs:2892:72:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior: sema rejects extendTtl with "method 'extendTtl' is not available on target <t>" (or similar) when the current target is not listed in the builtin's target set, matching the behaviour of target-gated builtin functions.
Also reproduces on --target polkadot and --target evm (different panic message, same root cause).
Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)
The Soroban-only builtin method
extendTtl(declared withtarget: vec![Target::Soroban]insrc/sema/builtin.rs) is accepted by sema on every target becauseBUILTIN_METHODSresolution atsrc/sema/builtin.rs:1446filters only by name and receiver type, not byfunc.target(the sibling function-call resolver at L899 does check).MRE:
Reproduce: save as
mre.sol, runsolang compile --target solana mre.sol.Output:
Expected behavior: sema rejects
extendTtlwith"method 'extendTtl' is not available on target <t>"(or similar) when the current target is not listed in the builtin'stargetset, matching the behaviour of target-gated builtin functions.Also reproduces on
--target polkadotand--target evm(different panic message, same root cause).Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)