Skip to content

"->" is treated as "." in C++ #699

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
AdityaPrakash-26 opened this issue May 3, 2021 · 0 comments
Open

"->" is treated as "." in C++ #699

AdityaPrakash-26 opened this issue May 3, 2021 · 0 comments

Comments

@AdityaPrakash-26
Copy link

AdityaPrakash-26 commented May 3, 2021

🐛 Bug Report

Even though I have saved the file multiple times, and using the -> to access the property of a pointer(using C++), the extension converts it to . and passes it to the judge. See the error statement

To Reproduce

I wrote the code:

for(int i = 0; i<n; i++){
    t1 = t1->next; 
}

and got the following error:

Line 27: Char 14: error: member reference type 'ListNode *' is a pointer; did you mean to use '->'?
Line 27: Char 14: error: member reference type 'ListNode *' is a pointer; did you mean to use '->'?
        t1=t1.next;
           ~~^
             ->

Expected behavior

The code should have been submitted properly, instead I am getting an unexpected compile error.

Extension Output

  • Sending code to judge
    (node:3840) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
    (Use node --trace-warnings ... to show where the warning was created)
  • Waiting for judge result
  • Waiting for judge result
  • Waiting for judge result
  • Waiting for judge result
    ✘ Compile Error
    ✘ Error: Line 27: Char 14: error: member reference type 'ListNode *' is a pointer; did you mean to use '->'?
    ✘ Error: Line 27: Char 14: error: member reference type 'ListNode *' is a pointer; did you mean to use '->'?
    t1=t1.next;
    ~~^
    ->
    ✘ Your Input: [1,2,3,4,5]
    2
    ✘ Expected Answer:
    ✘ Stdout:

Your Environment

  • os: macOS Big Sur 11.3
  • extension settings: default(logged in via LinkedIn)
  • nodejs version: 14.16.1
  • vscode version: 1.55.2 (Universal)
  • extension version: 0.17.0
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

1 participant