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: Green gutter icons over constants without RHS #5842

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ await VerifyTrace(@"
? :}", false, intermediates: false);
}

[Fact]
public async Task ConstantWithoutRhsMarkedAsVerified() {
await VerifyTrace(@"
| :class Test {
| : const x: int
| :
| : method Testing()
| : requires x > 0
| : ensures x != 0
| : {
| : }
| :}", false, intermediates: false);
}

[Fact]
public async Task Fields() {
var markedSource = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ void AddAndPossiblyMigrateVerificationTree(VerificationTree verificationTree) {
continue;
}

if (member is ConstantField) {
var constantHasNoBody = member.RangeToken.EndToken.line == 0;
if (constantHasNoBody) {
if (member is ConstantField constantField) {
if (constantField.Rhs == null) {
continue; // Nothing to verify
}

Expand Down
1 change: 1 addition & 0 deletions docs/dev/news/5841.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Green gutter icons cover constants without RHS