Skip to content

[BUGFIX] Fix Enum array constructors throwing an error - #569

Merged
AbnormalPoof merged 1 commit into
FunkinCrew:developfrom
nykwono:enum-wildcard-array-fix
Oct 23, 2026
Merged

AbnormalPoof merged 1 commit into
FunkinCrew:developfrom
nykwono:enum-wildcard-array-fix

Conversation

@nykwono

@nykwono nykwono commented Oct 23, 2026 •

Copy link
Copy Markdown

This PR fixes an issue where if you have an enum with a constructor, then if it contains an Array as a variable it'll throw an error.
This also makes it so an error is only thrown with switch array matching if the array is undeclared.

Old

override function onCreate(e):Void
{
  var val = Foo.Bar([1, 2, 3]);
  switch (val)
  {
    case Bar(v):
      trace(v);
    default:
      trace("fjdfnjfd");
  }
}

Throws:

An unknown error occurred: Cannot bind matched tuple to variable "v", use "_" instead

New

hscriptClass(assets/ui/TestScript.hxc):19:  1,2,3
override function onCreate(e):Void
{
  switch ([1, 2, 3])
  {
    case s:
      trace(s);
  }
}

Throws:

An unknown error occurred: Cannot bind matched tuple to variable "s", use "_" instead.

@AbnormalPoof AbnormalPoof reopened this Oct 23, 2026
@AbnormalPoof
AbnormalPoof merged commit 7609b86 into FunkinCrew:develop Oct 23, 2026
18 checks passed
@nykwono
nykwono deleted the enum-wildcard-array-fix branch October 23, 2026 22:03
@NotHyper-474

Copy link
Copy Markdown
Contributor
Screenshot_20261023-193212 Gmail~2 image

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.

3 participants