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

Error if calling a string/template/number literal #611

Open
strager opened this issue Jan 6, 2022 · 20 comments
Open

Error if calling a string/template/number literal #611

strager opened this issue Jan 6, 2022 · 20 comments
Assignees
Labels
good first issue Good for newcomers and C++ beginners

Comments

@strager
Copy link
Collaborator

strager commented Jan 6, 2022

let randomVar = 5();

5 is called as if it was a function. We should report an error for trivial cases like this.

In the future, we might want to provide a nice diagnostic suggesting inserting a semicolon in cases like the following (suggested by elliot416):

let randomVar = 5 // <-- no semicolon
 
(function() {
 
});
@strager strager added the good first issue Good for newcomers and C++ beginners label Jan 6, 2022
@Ishvina
Copy link

Ishvina commented Jan 20, 2022

Hi! I am in an intro to swe class that is requiring me to work on my first open-source project. I was wondering if this issue is still open and if so could I get help with my first contribution?

@strager
Copy link
Collaborator Author

strager commented Jan 20, 2022

Yes, this task is still open.

I can definitely help you with this task if you have problems. I can answer questions here or weekdays on my Twitch stream (https://twitch.tv/strager). (However, I'm on a vacation right now, so my availability is spotty until January 26.)

cc @singalhimanshu who can help if I'm not around.

@Ishvina
Copy link

Ishvina commented Jan 20, 2022

Ok perfect thank you so much!

@singalhimanshu
Copy link
Contributor

@Ishvina let me know if you are facing any issues.

@Ishvina
Copy link

Ishvina commented Jan 21, 2022

@singalhimanshu Hi! Thank you. Can you tell me where to begin and where I should find these errors?

@singalhimanshu
Copy link
Contributor

@singalhimanshu Hi! Thank you. Can you tell me where to begin and where I should find these errors?

Have you done the project setup? Are you able to run quick-lint-js on js files? If not follow the instructions here - https://github.com/quick-lint/quick-lint-js/blob/master/docs/BUILDING.md

@strager
Copy link
Collaborator Author

strager commented Jan 21, 2022

Can you tell me where to begin and where I should find these errors?

I usually start by reproducing the problem. In this case, the problem is that quick-lint-js reports no error, but Node.js does report an error (when the code runs). I'd reproduce by creating a .js file and running quick-lint-js and Node.js on the .js file. (You need to build quick-lint-js from source by following the instructions @singalhimanshu linked.)

Then, I'd write a test case. I'd probably write a test in test/test-parse-expression.cpp. In order to write the test, we need a new error type, which we'd add in src/quick-lint-js/fe/diagnostic-types.h.

@mketer1
Copy link

mketer1 commented Mar 22, 2022

Hi! I am taking an intro class that requires me to work on my first open-source project. I noticed that this issue was assigned two months ago but has not been resolved. If this issue is still open, could I be assigned it?

@strager
Copy link
Collaborator Author

strager commented Mar 22, 2022

@Ishvina Are you still working on this task?

@mketer1
Copy link

mketer1 commented Mar 22, 2022

If @Ishvina does not respond, would I be able to receive assignment for this task. Also, because I'm still new to open source contribution, would it be possible to get guidance/assistance if need be?

@strager
Copy link
Collaborator Author

strager commented Mar 22, 2022

If @Ishvina does not respond, would I be able to receive assignment for this task.

Yes.

[...] would it be possible to get guidance/assistance if need be?

Yes, of course.

@strager
Copy link
Collaborator Author

strager commented May 27, 2022

@mketer1 Do you still want to work on this task?

@fk00750
Copy link

fk00750 commented Aug 1, 2022

Hey @strager can I work on this task?

@strager
Copy link
Collaborator Author

strager commented Aug 1, 2022

@fk00750 You may.

@strager strager assigned fk00750 and unassigned Ishvina Aug 1, 2022
@strager
Copy link
Collaborator Author

strager commented Sep 25, 2022

@fk00750 Are you still working on this task? Do you need any help?

@catmar22
Copy link

Hello! Has this been resolved yet? If not I'm also interested in trying to solve this

@strager
Copy link
Collaborator Author

strager commented Nov 10, 2022

@catmar22 I think @fk00750 abandoned the task. You can take it over.

@strager strager assigned catmar22 and unassigned fk00750 Nov 10, 2022
@adrperez5
Copy link

Hi @strager, has this issue been resolved? I would like to give it a go.

@strager
Copy link
Collaborator Author

strager commented Apr 27, 2024

@adrperez5 It looks like there were a lot of people who accepted the task then disappeared. Maybe this task is haunted... Are you sure you want to take it on?

@strager strager assigned adrperez5 and unassigned catmar22 Apr 27, 2024
@adrperez5
Copy link

I will try my best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers and C++ beginners
Projects
None yet
Development

No branches or pull requests

7 participants