Skip to content

MSVC gives different outputs compared to WSL build, Linux/Mac OS ? #1593

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

Open
faze-geek opened this issue Mar 20, 2023 · 5 comments
Open

MSVC gives different outputs compared to WSL build, Linux/Mac OS ? #1593

faze-geek opened this issue Mar 20, 2023 · 5 comments

Comments

@faze-geek
Copy link
Contributor

faze-geek commented Mar 20, 2023

I have come across some instances where I felt that the MSVC build set up gives different outputs to other machines. One such case can be seen in #1590 .

Snippet -

def fun():
    x : dict[i32, i32] = {1: 2}
    print(x[1])

    y : dict[str, i32]
    y = {"apple": 1}
    print(y["apple"])

fun()

On my MSVC windows setup -

(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
code generation error: Variable type not supported 12
 --> try.py:5:5
  |
5 |     y : dict[str, i32]
  |     ^^^^^^^^^^^^^^^^^^

On my WSL with windows setup -

(lp) faze-geek@DESKTOP-497JDCU:~/lpython/lpython$ ./src/bin/lpython try.py
2
1

@Smit-create @certik Any possible reasons why this might be happening. We should look into this.

@faze-geek
Copy link
Contributor Author

Here is another case where even after the pr fixing #1524 MSVC does not generate the correct result. Look at the comments - #1524 (comment) . Smit was not able to reproduce these results on his main if I recall correctly.

@harshsingh-24
Copy link
Contributor

Even I am facing the same issue as stated above. I am also working with the MSVC compiler on Windows. I raised an issue too.

@Thirumalai-Shaktivel
Copy link
Collaborator

@faze-geek, Can you please verify that both Windows and WSL generate the same ASR?

@Thirumalai-Shaktivel
Copy link
Collaborator

This Error message should only be shown for Global statements, but why does it show for the variables inside a function?
I don't know whether this error was introduced after this PR: #1491 was merged.
We need to investigate what's going on here.

@certik
Copy link
Contributor

certik commented Mar 20, 2023

We'll have to investigate why MSVC behaves differently.

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

No branches or pull requests

4 participants