Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Duplicate return value rejected #27913

Open
evan-schott opened this issue Apr 22, 2024 · 0 comments
Open

[Bug] Duplicate return value rejected #27913

evan-schott opened this issue Apr 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@evan-schott
Copy link
Collaborator

evan-schott commented Apr 22, 2024

program inner.aleo {
    transition main(a: address) -> (address, address) {
        return (a, a);
    }
}
thread `main` panicked at compiler/passes/src/flattening/flatten_statement.rs:277:18:
internal error: entered unreachable code: SSA guarantees that the expression is always an identifier or unit expression.
stack backtrace: 
   0: backtrace::capture::Backtrace::create
   1: backtrace::capture::Backtrace::new
   2: leo::set_panic_hook::{{closure}}
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_handler::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: _rust_begin_unwind
   7: core::panicking::panic_fmt
   8: leo_passes::flattening::flatten_statement::<impl leo_ast::passes::reconstructor::StatementReconstructor for leo_passes::flattening::flattener::Flattener>::reconstruct_return
   9: leo_ast::passes::reconstructor::StatementReconstructor::reconstruct_statement
  10: leo_passes::flattening::flatten_statement::<impl leo_ast::passes::reconstructor::StatementReconstructor for leo_passes::flattening::flattener::Flattener>::reconstruct_block
  11: leo_passes::flattening::flatten_program::<impl leo_ast::passes::reconstructor::ProgramReconstructor for leo_passes::flattening::flattener::Flattener>::reconstruct_function
  12: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
  13: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  14: leo_ast::passes::reconstructor::ProgramReconstructor::reconstruct_program_scope
  15: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  16: <indexmap::map::IndexMap<K,V,S> as core::iter::traits::collect::FromIterator<(K,V)>>::from_iter
  17: leo_ast::passes::reconstructor::ProgramReconstructor::reconstruct_program
  18: leo_compiler::compiler::Compiler::flattening_pass
  19: leo_compiler::compiler::Compiler::compiler_stages
  20: leo_compiler::compiler::Compiler::compile
  21: <leo_lang::cli::commands::build::Build as leo_lang::cli::commands::Command>::apply
  22: leo_lang::cli::commands::Command::execute
  23: leo_lang::cli::cli::run_with_args
  24: scoped_tls::ScopedKey<T>::set
  25: leo::main
  26: std::sys_common::backtrace::__rust_begin_short_backtrace
  27: std::rt::lang_start::{{closure}}
  28: std::rt::lang_start_internal
  29: _main

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/AleoHQ/leo/issues/new?labels=bug,panic&template=bug.md&title=[Bug]

note: leo-lang 1.11.0 running on Darwin 23.2.0

note: compiler args: leo build

note: compiler flags: CLI { debug: false, quiet: false, command: Build { command: Build { options: BuildOptions { endpoint: "http://api.explorer.aleo.org/v1", non_recursive: false, offline: false, enable_symbol_table_spans: false, enable_initial_symbol_table_snapshot: false, enable_type_checked_symbol_table_snapshot: false, enable_unrolled_symbol_table_snapshot: false, enable_ast_spans: false, enable_dce: false, enable_all_ast_snapshots: false, enable_initial_ast_snapshot: false, enable_unrolled_ast_snapshot: false, enable_ssa_ast_snapshot: false, enable_flattened_ast_snapshot: false, enable_destructured_ast_snapshot: false, enable_inlined_ast_snapshot: false, enable_dce_ast_snapshot: false, conditional_block_max_depth: 10, disable_conditional_branch_type_checking: false } } }, path: None, home: None }
@evan-schott evan-schott added the bug Something isn't working label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant