plasma-umass / cwhy

"See why!" Explains and suggests fixes for compile-time errors for C, C++, C#, Go, Java, LaTeX, PHP, Python, Ruby, Rust, and TypeScript
Apache License 2.0
272 stars 6 forks source link

Refactored patterns, added C#. #19

Closed emeryberger closed 1 year ago

emeryberger commented 1 year ago

See above.

emeryberger commented 1 year ago

For future reference, turns out you can install the C# compiler on the Mac by running brew install mono and then you invoke it as mcs, as in mcs testme.cs.

emeryberger commented 1 year ago

Added a test for C#. Here's output for the C# error (correct):


% mcs testme.cs            
testme.cs(13,44): error CS1010: Newline in constant
testme.cs(15,12): error CS1525: Unexpected symbol `Console'
Compilation failed: 2 error(s), 0 warnings
% mcs testme.cs |& cwhy
The problem is that there is a syntax error in your code.
Specifically, on line 13, you have forgotten to close the string with
a quotation mark. The corrected line should be:

13             string message = "Hello World!!";