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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use java interfaces as models for unbound variables #1660

Open
adrns opened this issue Jan 9, 2023 · 0 comments
Open

Can't use java interfaces as models for unbound variables #1660

adrns opened this issue Jan 9, 2023 · 0 comments

Comments

@adrns
Copy link

adrns commented Jan 9, 2023

Hi 馃憢,
I've been using interfaces to define classes for Oso - for the reason I'd like to use the @Immutable annotation from org.immutables - like so:

@Immutable
public interface Foo {
    boolean bar();
}

Then having this interface registered with oso, accessing the method in the .polar file:

some_func(foo: Foo) if
    foo.bar();

I get the following whenever Foo is an unbound variable:
Not supported: cannot call method on unbound variable ...

So I've fallen back to using POJOs with public final fields instead of interfaces in those cases where the object might be an unbound variable. Is there any plans on adding support for method calls on unbound variables?

(I didn't think a more detailed example is required for the sake of raising this question, but can provide one if necessary)

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