-
Notifications
You must be signed in to change notification settings - Fork 256
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
Disambiguation priority not preserved when importing modules #4364
Comments
Following https://dafny.org/latest/DafnyRef/DafnyRef#483-expression-context-name-resolution, I'd expect that in both cases the type of
|
Thanks for the fix! I suggested Just to make sure I understand the documentation correctly,
and
right? And does this mean everything from an opened module will come after everything in the original module?
For example, is this the correct behavior? module A {
datatype T = foo(int)
method M() {
var x := foo(100);
assert x is T;
}
}
module B {
import opened A
function foo(x: int): int {
x * x
}
method M() {
var x := foo(100);
assert x is int;
}
} |
As for your first two questions, yes, that is how I understand it too. I don't think the last example should verify though. From the perspective of
If you have two datatype constructors with the same name, Dafny will report an error that asks for further clarification:
|
Dafny version
4.1.0
Code to produce this issue
Command to run and resulting output
What happened?
In
A
,foo
is resolved correctly to the function because it has a higher priority than the datatype constructor.In
B
, however, such priorities are not preserved when we import the moduleA
.foo
is resolved as a datatype constructor instead.What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: