-
Notifications
You must be signed in to change notification settings - Fork 261
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: Const initializations problems #1111 #1509
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d4906af
Adding test file for issue 1111
prvshah51 9958bad
Merge pull request #1 from prvshah51/prvshah_1
prvshah51 07d6728
Merge branch 'dafny-lang:master' into master
prvshah51 63bdaa2
miscc hanges
prvshah51 b659980
Made changes to the function call, added test an expect file. for #1111.
prvshah51 ae9d54b
change in expect file.
prvshah51 b8a5a23
made more changes in expect file.
prvshah51 2c3769e
Merge branch 'master' into prvshah_1111_2
prvshah51 20e7f1e
working on Unchanged files with check annotations.
prvshah51 c8af69e
Revert "working on Unchanged files with check annotations."
prvshah51 83e62ae
formatting for unchanged file with check annotations.
prvshah51 76d6006
More formatting.
prvshah51 386b5c6
using statements moved in namespaces.
prvshah51 3dfa099
removed using statements from commented part and added it to both nam…
prvshah51 666e121
more formatting.
prvshah51 ac19f7d
formatting on last 8 warning on "Files changed" section of PR.
prvshah51 4842bf7
Merge branch 'master' into prvshah_1111_2
prvshah51 b5030ab
Reverting changes made to using directive as that needs more testing.
prvshah51 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %dafny /compileTarget:java "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
module Foo { | ||
class A { | ||
|
||
const a : int | ||
const b : int | ||
|
||
constructor(k : int, j : int) | ||
{ | ||
//a := k; | ||
//b := j; | ||
a, b := k, j; | ||
} | ||
} | ||
method Main() | ||
{ | ||
var o := new A(1, 2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Dafny program verifier finished with 1 verified, 0 errors |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was removing this conditional compilation intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was part of the removing the formatting annotations.There was warning "Using directive should appear within a namespace declaration." So I have added both "using System" and "using System.Numerics" in both namespaces and removed from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving it is fine, but may still need the
#if ISDAFNYRUNTIMELIB
guard. This is because this file is used in two different ways: both as source for theDafnyRuntime
project (and thecsproj
file setsISDAFNYRUNTIMELIB
to true), but also as raw text that the C# compiler will prepend to the compiled program output if/useRuntimeLib
is not passed (in which caseISDAFNYRUNTIMELIB
is false by default).I'm not actually convinced it IS still necessary, mind you. But we need to double check both use cases work, and I'm a little worried the test suite doesn't cover this well. You might want to detach this improvement from this PR for the sake of avoiding scope creep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I am doing that. That can be addressed later.