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

Fix: Proper warning that 'new' cannot be used in expressions, instead of a parse error #3374

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

MikaelMayer
Copy link
Member

This PR fixes #3366
It does not remove the parse error as it was expected, but it does add an explanation of it.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@MikaelMayer MikaelMayer requested a review from alex-chew January 18, 2023 15:18
@@ -14,7 +14,7 @@ public class ExitCommand : ILitCommand {

public (int, string, string) Execute(ITestOutputHelper? outputHelper, TextReader? inputReader, TextWriter? outputWriter, TextWriter? errorWriter) {
var (exitCode, output, error) = operand.Execute(outputHelper, inputReader, outputWriter, errorWriter);
return (exitCode != expectedExitCode ? 1 : 0, output, error);
return (exitCode != expectedExitCode ? 1 : 0, output, error + $"\nMoreover the expected exit code was {expectedExitCode} but got {exitCode}");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is manually tested and was useful to understand why my original tests with %exits-with 1 was failing without indication about what was wrong.

Co-authored-by: Alex Chew <alex-chew@users.noreply.github.com>
@MikaelMayer MikaelMayer enabled auto-merge (squash) January 18, 2023 18:02
Copy link
Contributor

@alex-chew alex-chew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MikaelMayer MikaelMayer requested a review from alex-chew January 18, 2023 18:03
@MikaelMayer MikaelMayer merged commit 6292221 into master Jan 18, 2023
@MikaelMayer MikaelMayer deleted the fix-3366-parse-failure-new branch January 18, 2023 18:24
davidcok pushed a commit to davidcok/dafny that referenced this pull request Jan 20, 2023
… of a parse error (dafny-lang#3374)

Co-authored-by: Alex Chew <alex-chew@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Parse failure on Some(new C<nat>(0))
2 participants