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

Feature Request: Support for method references referencing properties #666

Open
EotT123 opened this issue Jan 25, 2025 · 0 comments
Open

Comments

@EotT123
Copy link
Contributor

EotT123 commented Jan 25, 2025

Currently, manifold properties cannot be used as method references. Instead, the getter method should be used.

For example, consider the following class:

public class MyObject {
  @get Object foo;
  // constructor and other methods
}

Currently, to use the property in a stream operation, you need to reference the getter explicitly:

List<Object> values = Stream.of(new MyObject("test")).map(MyObject::getFoo).toList();

However, it would be more concise and intuitive if we could reference the property directly via a method reference (as IntelliJ is also suggesting):

List<Object> values = Stream.of(new MyObject("test")).map(MyObject::foo).toList();
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