Dafny can't model C# classes without public constructors #313
Labels
area: ffi
The {:extern} attribute and otherwise interfacing with code in other languages
kind: enhancement
Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
priority: not yet
Will reconsider working on this when we're looking for work
Suppose I have the following C# classes, which are given by some library and I can't change:
Note that the constructor of
Foo
is private, and some part of the library I know nothing about will construct newFoo
objects.I try to model this in Dafny as follows:
But I get the error
The obvious workaround is to just add a constructor in Dafny, but then if I write a Dafny file which uses this constructor, it will verify and successfully compile to a C# program, but compiling the C# program will fail. This is undesirable. It would be better if Dafny did not require a constructor for fully extern classes.
The text was updated successfully, but these errors were encountered: