Skip to content

Fix file-scope contract call handling in Solana#1875

Open
Embers-of-the-Fire wants to merge 5 commits intohyperledger-solang:mainfrom
Embers-of-the-Fire:bug/solana-state-init-external-call
Open

Fix file-scope contract call handling in Solana#1875
Embers-of-the-Fire wants to merge 5 commits intohyperledger-solang:mainfrom
Embers-of-the-Fire:bug/solana-state-init-external-call

Conversation

@Embers-of-the-Fire
Copy link
Copy Markdown

@Embers-of-the-Fire Embers-of-the-Fire commented Apr 16, 2026

Should closes #1869

  • fix a Solana sema panic when a state-variable initializer contains an external self-call and context.function_no is None
  • limit the Solana accounts-required check to real function contexts so file-scope initializers no longer hit an unwrap or emit a spurious diagnostic
  • add a regression test that asserts the initializer is preserved as an ExternalFunctionCall for uint public x = this.foo();

Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
@Embers-of-the-Fire Embers-of-the-Fire force-pushed the bug/solana-state-init-external-call branch from f132e0b to 74293dd Compare April 16, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler panic in sema: Option::unwrap() on None for context.function_no when an external call appears in a state-variable initializer

1 participant