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

More lambda-friendly variants for runRemotely #894

Open
jglick opened this issue Jan 10, 2025 · 0 comments
Open

More lambda-friendly variants for runRemotely #894

jglick opened this issue Jan 10, 2025 · 0 comments

Comments

@jglick
Copy link
Member

jglick commented Jan 10, 2025

I have discovered a usability flaw in #882, that

rr.runRemotely(r -> someStatement());

(where someStatement is a method returning void) does not compile, as javac tries to use Step2 when Step was meant. You can work around it via

rr.runRemotely((RealJenkinsRule.Step) r -> someStatement());

or

rr.runRemotely(r -> {someStatement();});

but both are awkward. It would be better to introduce aliases like run(Step) + call(Step2) which would more identify the expected lambda type.

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