Skip to content

Added assert() to Signal#253

Open
Vetnech wants to merge 1 commit into
Sleitnick:mainfrom
Vetnech:patch-1
Open

Added assert() to Signal#253
Vetnech wants to merge 1 commit into
Sleitnick:mainfrom
Vetnech:patch-1

Conversation

@Vetnech
Copy link
Copy Markdown

@Vetnech Vetnech commented Nov 2, 2025

Added a check to make sure :Once, :ConnectOnce and :Connect receive a function so that users do not get confused by the naturally occurring error when they forget to pass a function (like me) or pass something else.

Added a check to make sure :Once, :ConnectOnce and :Connect receive a function.
@Vetnech Vetnech changed the title Update init.luau Added assert() to Signal Nov 2, 2025
@Sleitnick
Copy link
Copy Markdown
Owner

Is there a reason the type-checker didn't catch this issue for you?

@Vetnech
Copy link
Copy Markdown
Author

Vetnech commented Nov 7, 2025

Is there a reason the type-checker didn't catch this issue for you?

I only received an internal error when the signal was later fired (when the module was looping through the connections and calling each connected function?) which could be confusing as it doesn't traceback to the wrong connection. It personally took a while because the connection without any functions passed was made at a section I had half finished before moving onto a different script.

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

Successfully merging this pull request may close these issues.

2 participants