Skip to content

TSL: Make Switch Case return void#2097

Merged
Methuselah96 merged 1 commit intothree-types:masterfrom
thelazylamaGit:SwitchCaseVoid
Mar 28, 2026
Merged

TSL: Make Switch Case return void#2097
Methuselah96 merged 1 commit intothree-types:masterfrom
thelazylamaGit:SwitchCaseVoid

Conversation

@thelazylamaGit
Copy link
Copy Markdown
Contributor

Currently when doing a Switch statement in TSL such as

Switch( 0 ).Case( 0, () => {
    col.assign( color( 1, 0, 0 ) );
})

typescript complains

Argument of type '() => void' is not assignable to parameter of type 'Node'. Type '() => void' is not assignable to type 'NodeClass'.

Simple fix is to change Case type in StackNode.d.ts from

Case(...params: Node[]): this;

to

Case(...params: [...Node[], () => void]): this;

Copy link
Copy Markdown
Contributor

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Methuselah96 Methuselah96 merged commit 66b9b94 into three-types:master Mar 28, 2026
6 checks passed
@thelazylamaGit thelazylamaGit deleted the SwitchCaseVoid branch March 28, 2026 16:21
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