Skip to content

Add explicit builder for default functions that do not return anything - #8846

Open
Efnilite wants to merge 2 commits into
dev/featurefrom
feature/void-default-functions
Open

Add explicit builder for default functions that do not return anything #8846
Efnilite wants to merge 2 commits into
dev/featurefrom
feature/void-default-functions

Conversation

@Efnilite

Copy link
Copy Markdown
Member

Problem

Previously, all default functions were expected to return a value. For default functions with side effects, this required returning a dummy value or null in the build method.

Solution

Adds explicit support for functions that do not return anything by means of a voidBuilder method. This changes the final build method in the function build pipeline to take a Consumer instead of a Function, which removes the need for the developer to return a value.

Testing Completed

Updated FunctionRegistryTest to use void default functions.

Supporting Information


Completes: none
Related: none
AI assistance: none

@Efnilite Efnilite added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Aug 18, 2026
@Efnilite
Efnilite requested a review from a team as a code owner August 18, 2026 12:06
@Efnilite
Efnilite requested review from Absolutionism and erenkarakal and removed request for a team August 18, 2026 12:06
@Efnilite Efnilite moved this to In Review in 2.17 Releases Aug 18, 2026
Comment thread src/main/java/org/skriptlang/skript/common/function/DefaultFunctionImpl.java Outdated
@Efnilite
Efnilite force-pushed the feature/void-default-functions branch from 696f3dd to 6f73b72 Compare August 21, 2026 15:14
@skriptlang-automation skriptlang-automation Bot added the needs reviews A PR that needs additional reviews label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request, an issue about something that could be improved, or a PR improving something. needs reviews A PR that needs additional reviews

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants