-
Notifications
You must be signed in to change notification settings - Fork 257
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
datatype doesn't correctly compute equality-support #1427
Comments
I should probably provide a little more context: the reason this came up is that I have an extern type (defined via C++) with no operator== defined. In the C++ backend, this results in compile errors. (Because when generating code for type X, it tries to call out to T's This is inconsistent across the backends, and we should think about which is the desired behavior. Personally I'd argue that failing to compile makes more sense - I can't really think of any reason why falling back to pointer equality would make sense. |
* Source/Dafny/Resolver.cs (DetermineEqualitySupport): Change early-exit criterion: use general `Type.SupportsEquality` instead of special-casing codatatypes and arrow types. Separately check for datatypes to avoid infinite recursion.
* Source/Dafny/Resolver.cs (DetermineEqualitySupport): Change early-exit criterion: use general `Type.SupportsEquality` instead of special-casing codatatypes and arrow types. Separately check for datatypes to avoid infinite recursion.
The issue here is that the test in dafny/Source/Dafny/Resolver.cs Line 9683 in b5ad10a
|
* Source/Dafny/Resolver.cs (DetermineEqualitySupport): Change early-exit criterion: use general `Type.SupportsEquality` instead of special-casing codatatypes and arrow types. Separately check for datatypes to avoid infinite recursion.
In the following, T doesn't have equality support, so X shouldn't either:
As far as I can tell, it only seems to apply to opaque types (e.g., if T is a datatype with a ghost field or something, then X will correctly compute that it doesn't have equality support).
The text was updated successfully, but these errors were encountered: