Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelMayer committed Jan 31, 2025
1 parent 6512bc3 commit 4d5a51b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Source/DafnyCore/DafnyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,18 @@ public T Get<T>(Argument<T> argument) {


public T Get<T>(Option<T> option) {
return (T)Options.OptionArguments.GetOrDefault(option, () => ((IValueDescriptor<T>)option) is {
HasDefaultValue: true
} valueDescriptor ? valueDescriptor.GetDefaultValue() : (object)default(T));
return (T)Options.OptionArguments.GetOrDefault(option, () => (object)default(T));
}


public T GetOrOptionDefault<T>(Option<T> option) {
return (T)Options.OptionArguments.GetOrDefault(option, () =>
((IValueDescriptor<T>)option) is {
HasDefaultValue: true
} valueDescriptor
? valueDescriptor.GetDefaultValue()
: (object)default(T)
);
}

public object Get(Option option) {
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/Verifier/BoogieGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public Bpl.Program DoTranslation(Program p, ModuleDefinition forModule) {
return new Bpl.Program();
}

if (Options.Get(CommonOptionBag.LogLevelOption).CompareTo(LogEventLevel.Verbose) <= 0) {
if (Options.GetOrOptionDefault(CommonOptionBag.LogLevelOption).CompareTo(LogEventLevel.Verbose) <= 0) {
Options.OutputWriter.WriteLine("Starting translation to Boogie of module " + forModule.FullDafnyName);
}

Expand Down

0 comments on commit 4d5a51b

Please sign in to comment.