File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ class IROptimizer {
158158 case InputOpcode . ADDON_CALL :
159159 break ;
160160
161+ case InputOpcode . CAST_BOOLEAN : {
162+ const innerType = inputs . target . type ;
163+ if ( innerType & InputType . BOOLEAN ) return innerType ;
164+ return InputType . BOOLEAN ;
165+ }
166+
161167 case InputOpcode . CAST_NUMBER : {
162168 const innerType = inputs . target . type ;
163169 if ( innerType & InputType . NUMBER ) return innerType ;
@@ -707,6 +713,14 @@ class IROptimizer {
707713 }
708714
709715 switch ( input . opcode ) {
716+ case InputOpcode . CAST_BOOLEAN : {
717+ const targetType = input . inputs . target . type ;
718+ if ( ( targetType & InputType . BOOLEAN ) === targetType ) {
719+ return input . inputs . target ;
720+ }
721+ return input ;
722+ }
723+
710724 case InputOpcode . CAST_NUMBER : {
711725 const targetType = input . inputs . target . type ;
712726 if ( ( targetType & InputType . NUMBER ) === targetType ) {
You can’t perform that action at this time.
0 commit comments