Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Commit 150461d

Browse files
committed
22.2.1
1 parent e224379 commit 150461d

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 22.2.1
2+
## Fixes
3+
- Fixed the `Special object cannot be an enum constructor` error showing up even if the special object is not an enum constructor
4+
15
# 22.2.0
26
## Additions
37
- Special objects now supports Classes and Enums

haxelib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"script"
1010
],
1111
"description": "SScript (also known as SuperlativeScript), fork of HScript with fixes and improvements.",
12-
"version": "22.2.0",
12+
"version": "22.2.1",
1313
"classPath": "src/",
1414
"releasenote": "Check CHANGELOG.md",
1515
"contributors": [

src/hscript/SScript.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,11 @@ class SScript
508508
if (Std.isOfType(obj, i))
509509
throw 'Special object cannot be ${i}';
510510

511-
if (Type.getEnum(obj) != null)
512-
throw 'Special object cannot be an enum constructor (${Type.getEnumName(Type.getEnum(obj))})';
511+
switch Type.typeof(obj) {
512+
case TEnum(e):
513+
throw 'Special object cannot be an enum constructor (${Type.getEnumName(e)})';
514+
default:
515+
}
513516

514517
if (interp.specialObject == null)
515518
interp.specialObject = {obj: null, includeFunctions: null, exclusions: null};

0 commit comments

Comments
 (0)