Skip to content
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

Aliasing Checker : Returning @Unique object does not raise an error #3486

Open
aditya3434 opened this issue Jul 21, 2020 · 0 comments
Open

Comments

@aditya3434
Copy link
Contributor

Consider the code given below.

@Unique
class Data {

    Object check(Data p) { return p; }   // No error

    Object check2(@Unique Data p) { return p; }   // No error

}

When the code is compiled by the Aliasing Checker, it doesn't raise any error even when the object is explicitly annotated.

Shouldn't it ideally raise an error in the return p line, since Data p is @Unique and is now leaked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant