internal error when f.Keys is used to define a const field Keys of a datatype #4394
Labels
crash
Dafny crashes on this input, or generates malformed code that can not be executed
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
part: verifier
Translation from Dafny to Boogie (translator)
Dafny version
4.2.0
Code to produce this issue
Command to run and resulting output
What happened?
Dafny encountered an internal error. Please report it at https://github.com/dafny-lang/dafny/issues.
System.InvalidCastException: Unable to cast object of type 'Microsoft.Dafny.InferredTypeProxy' to type 'Microsoft.Dafny.SetType'.
at Microsoft.Dafny.Translator.GetReadonlyField(Field f)
at Microsoft.Dafny.Translator.AddClassMembers(TopLevelDeclWithMembers c, Boolean includeAllMethods, Boolean includeInformationAboutType)
at Microsoft.Dafny.Translator.AddRevealableTypeDecl(RevealableTypeDecl d)
at Microsoft.Dafny.Translator.DoTranslation(Program p, ModuleDefinition forModule)
at Microsoft.Dafny.Translator.Translate(Program p, ErrorReporter reporter, TranslatorFlags flags)+MoveNext()
at System.Collections.Generic.List
1..ctor(IEnumerable
1 collection)at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at Microsoft.Dafny.LanguageServer.Language.DafnyProgramVerifier.<>c__DisplayClass4_0.<GetVerificationTasksAsync>b__1() at System.Threading.Tasks.Task
1.InnerInvoke()at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Microsoft.Dafny.LanguageServer.Language.DafnyProgramVerifier.GetVerificationTasksAsync(CompilationAfterResolution compilation, CancellationToken cancellationToken)
at Microsoft.Dafny.LanguageServer.Workspace.CompilationManager.PrepareVerificationTasksAsync(CompilationAfterResolution loaded, CancellationToken cancellationToken)
at Microsoft.Dafny.LanguageServer.Workspace.CompilationManager.TranslateAsync()
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: