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] assigning to string slice causes not implemented: strings do not exist on ASG level #1025

Closed
0rphon opened this issue Jun 8, 2021 · 3 comments · Fixed by #1027
Closed
Assignees
Labels
bug Something isn't working

Comments

@0rphon
Copy link
Contributor

0rphon commented Jun 8, 2021

🐛 Bug Report

Code snippet to reproduce

function main() {
    let x = "hello world";
    x[..2] = "ab";
}

Stack trace & error message

D:\Work\leo-playground>D:\Work\leo_repos\leo\target\release\leo clean && D:\Work\leo_repos\leo\target\release\leo run
      Done Finished in 0 milliseconds 

     Build Starting...
     Build Compiling main program... ("D:\\Work\\leo-playground\\src/main.leo")
thread 'main' panicked at 'not implemented: strings do not exist on ASG level', asg\src\expression\constant.rs:224:17
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\std\src\panicking.rs:493
   1: core::panicking::panic_fmt
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\core\src\panicking.rs:92
   2: <leo_asg::expression::constant::Constant as leo_asg::node::FromAst<leo_ast::expression::value::ValueExpression>>::from_ast
   3: <&leo_asg::expression::Expression as leo_asg::node::FromAst<leo_ast::expression::Expression>>::from_ast
   4: leo_asg::statement::assign::<impl leo_asg::node::FromAst<leo_ast::statements::assign::AssignStatement> for &leo_asg::statement::Statement>::from_ast
   5: <&leo_asg::statement::Statement as leo_asg::node::FromAst<leo_ast::statements::statement::Statement>>::from_ast
   6: <leo_asg::statement::block::BlockStatement as leo_asg::node::FromAst<leo_ast::statements::block::Block>>::from_ast
   7: leo_asg::program::function::Function::fill_from_ast
   8: leo_asg::program::Program::new
   9: leo_compiler::compiler::Compiler<F,G>::parse_program
  10: leo_compiler::compiler::Compiler<F,G>::parse_program_with_input
  11: <leo::commands::build::Build as leo::commands::Command>::apply
  12: leo::commands::Command::execute
  13: leo::commands::Command::execute
  14: leo::commands::Command::execute
  15: leo::commands::Command::try_execute
  16: snarkvm_algorithms::snark::groth16::VerifyingKey<E>::write
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Your Environment

  • leo commit c33facb
  • rustc version 1.53.0-nightly
  • Windows 10.0.19042 (Windows 10 Pro) [64-bit]
@0rphon 0rphon added feature A new feature. fuzz-bug labels Jun 8, 2021
@bendyarm
Copy link
Collaborator

bendyarm commented Jun 8, 2021

Can you explain a little? The program looks fine to me, so if it doesn't compile that would be a bug. Also, why does the title talk about ASGs?

@0rphon
Copy link
Contributor Author

0rphon commented Jun 8, 2021

@bendyarm i named the title exactly what the panic says. thread 'main' panicked at 'not implemented: strings do not exist on ASG level'. ill adjust the tags appropriately

@0rphon 0rphon added bug Something isn't working and removed feature A new feature. labels Jun 8, 2021
@0rphon 0rphon changed the title [Bug] strings do not exist on ASG level [Bug] assigning to string slice causes not implemented: strings do not exist on ASG level Jun 8, 2021
@0rphon
Copy link
Contributor Author

0rphon commented Jun 8, 2021

my bad, i was under the impression that this was just complaining about unimplemented behavior. Ive updated everything to reflect that its a bug instead

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

Successfully merging a pull request may close this issue.

3 participants