Skip to content

Map setters using map getters #489

@imaqtkatt

Description

@imaqtkatt
def main():
  map = { 0: 1, 1: 10 }
  map[map[0]] = 99
  return map[map[0]]

Expected: 99
Actual:

thread 'main' panicked at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bend-lang-0.2.18/src/imp/to_fun.rs:366:30:
internal error: entered unreachable code
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: bend::imp::to_fun::<impl bend::imp::Expr>::to_fun
   4: bend::imp::to_fun::<impl bend::imp::Stmt>::into_fun
   5: bend::imp::to_fun::<impl bend::imp::Stmt>::into_fun
   6: bend::fun::parser::TermParser::parse_book
   7: bend::execute_cli_mode::{{closure}}
   8: bend::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilationCompilation of terms and functions to HVM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions