How to better warn users? #4507
Replies: 2 comments
-
I think that option 2 "Raise a warning/error if we import opened a module which has a function of the same name (like we would do if there is a duplicate function definition)" is best, and I'm surprised to learn that it's not what's already implemented now. |
Beta Was this translation helpful? Give feedback.
-
Definitely not 3. (It would be weird to have such a proof obligation.) Here are some food for thought: I like the idea of generating a warning, but I'm not sure what.
Option 2 might make sense if shadowing is turned off. There are other ways that shadowing could occur. For example: function Fib(n: nat): nat { ... }
class MyClass {
lemma L() {
... Fib ... // this refers to MyClass.Fib, but perhaps the programmer wanted the Fib from the module scope
}
function Fib(n: nat): nat { ... }
} |
Beta Was this translation helpful? Give feedback.
-
I came across the following case:
The assertion is obvious but it fails., all because resolution picks up a different function and Dafny does not know they are equal.
This caused us some headache today to find.
What should we do?
Ideas welcome
Beta Was this translation helpful? Give feedback.
All reactions