Skip to content

Unexpected Error When Combining Refinement and StateRefinement #78

@rcosta358

Description

@rcosta358

In the following example, both the state refinement and the parameter refinement are individually valid, but when used together, the type checker returns the error Variable 'this' not found, which is probably a side effect of this bug.

@StateRefinement(from="downloading(this)", to="progress(this) == percentage")
public void updateProgress(@Refinement("percentage > progress(this)") int percentage) {} // Variable 'this' not found

By putting all the logic in the @StateRefinement, it works:

@StateRefinement(from="downloading(this) && percentage > progress(this)", to="progress(this) == percentage")
public void updateProgress(int percentage) {} // no error

By removing either one of them, we also don't get an error:

public void updateProgress(@Refinement("percentage > progress(this)") int percentage) {} // no error

// or

@StateRefinement(from="downloading(this)", to="progress(this) == percentage")
public void updateProgress(int percentage) {} // no error

There seems to be some kind of conflict between the two.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions