Skip to content

Fixes complex datatype's symbol duplication bug while using interactive #2707

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

Merged
merged 1 commit into from
May 16, 2024

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
14 checks passed
@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