Skip to content

Conversation

Vipul-Cariappa
Copy link
Contributor

Orginal Bug:

❯ lp
>>> l: list[i32] = [1, 2, 3]
>>> print(l)
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
  Binary file "/home/vipul/Workspace/bin/lpython/src/bin/lpython", in _start()
  Binary file "/lib64/libc.so.6", in __libc_start_main_alias_2()
  Binary file "/lib64/libc.so.6", in __libc_start_call_main()
  Binary file "/home/vipul/Workspace/bin/lpython/src/bin/lpython", in main()
  File "lpython.cpp", line 0, in (anonymous namespace)::interactive_python_repl(LCompilers::PassManager&, LCompilers::CompilerOptions&, bool) [clone .isra.0]
  Binary file "/home/vipul/Workspace/bin/lpython/src/bin/lpython", in LCompilers::PythonCompiler::evaluate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, LCompilers::LocationManager&, LCompilers::PassManager&, LCompilers::diag::Diagnostics&)
LCompilersException: addModule() returned an error: Duplicate definition of symbol 'l'

I just followed the way visit_Variable handles normal integer types and adapted it to work with list, dict, etc.

@Vipul-Cariappa
Copy link
Contributor Author

cc: @Shaikh-Ubaid

Copy link
Collaborator

@ubaidsk ubaidsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Thanks for this!

@ubaidsk ubaidsk merged commit fbbdbdd into lcompilers:main May 16, 2024
@Vipul-Cariappa Vipul-Cariappa deleted the symbol-duplication branch May 28, 2024 10:33
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.

2 participants