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 CS1525: Unexpected symbol" on Run (Alt+Shift+Enter) #1

Closed
davidhq opened this issue Jun 16, 2013 · 3 comments
Closed

"error CS1525: Unexpected symbol" on Run (Alt+Shift+Enter) #1

davidhq opened this issue Jun 16, 2013 · 3 comments

Comments

@davidhq
Copy link

davidhq commented Jun 16, 2013

Hi!

Great tool! I have a problem though...

I paste this in the window:

List<string> strings = new List<string>();
strings.Add("Good");
strings.Add("Morning")
strings.Add("Starshine");
strings.Add("The");
strings.Add("Earth");
strings.Add("says");
strings.Add("hello");

strings.Where(s => s.Length == 5);

and when I hit Alt+Shift+Enter I get:

(4,0): error CS1525: Unexpected symbol strings'`

When I move to each line and hit Alt+Enter everything executes well...:

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]

[Evaluating external code (Scratchpad.csx)]
{Earth, hello}

so it must be some kind of bug... can you please check?

thank you!
david

@lukebuehler
Copy link
Owner

There are 2 things going on, first you forgot a semicolon ";" on the 3rd line. But you are right, pasting multi-line statements to the REPL doesnt work right now, but I'll add that soon, I think it should be supported.

If add all the code to one line and fix the colon it should work.

@lukebuehler
Copy link
Owner

One more thing, if you select the whole block of code in a script file and then hit alt+Enter it will work!

@davidhq
Copy link
Author

davidhq commented Jun 17, 2013

oh the semicolon! that's the culprit for the entire issue...
when I add it, everything works.. so not sure what you are saying that pasting multi-line statements doesn't work...

when I don't add the semicolon, select the entire code and hit alt+Enter, it's still the same error..

the reason I didn't pick up on the error message saying the error was on (4,0) is that I was sure the problem is in the first line and (4,0) is referring to "strings" symbol there.. when in reality it was the 4th line (because the semicolon was missing on the third line)..

I'm happy , everything works! :) thank you!

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

2 participants