-
Notifications
You must be signed in to change notification settings - Fork 29
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
Problems with selective importing #166
Comments
As a workaround, selective importing of a package's contents was disabled for now |
Update: there is a prototype solution on branch |
There is a |
There is a testcase because we disabled selective imports completely to make it work. This issue however is meant to eventually fix this such that we need to desugar, encode, and possibly verify less |
PR #619 provides a middle a good compromising solution to this issue. In particular, this solution does not desugar any private member, which should make the size of the translations into Viper in projects like SCION much smaller without requiring any extra analysis of the parsed program. The disadvantage is that it may not clean members as aggressively as a dedicated analysis could |
The content of imported packages is loaded lazily. While working on the stubs, I came across this bug. I have two source files
A
andB
from different packages andA
contains a call to a function defined inB
.A
B
If I verify file
A
in Gobra, I get the following errorThis occurs because the
Test
predicate is not included in the final viper file because it is not explicitly accessed. If themain
function ofA
is changed tothen everything works again.
An analogous case occurs if I replace
F1
withF2
in themain
function of fileA
because the functionf()
accessed in the contract ofF2
is also not explicitly mentioned inA
, and thus, it is not added to the final code.This has subtle consequences in case we ever opt to follow Go's practice of exporting only the upper case names, because we would need to guarantee that all entities accessed in the contract of an exported function/method are also exportable (i.e. have an upper case name).
A potential fix for this would be to perform a transitive closure to detect all dependencies of a function contract or else, to import everything in the final viper file.
The text was updated successfully, but these errors were encountered: