From a1b1ace93d633e4dba2dea8695ee2944bfe0abc0 Mon Sep 17 00:00:00 2001 From: flashultra Date: Tue, 17 Dec 2024 14:15:20 +0200 Subject: [PATCH] Fix for issue 11888 (#11889) --- std/lua/_lua/_hx_bit.lua | 1 + tests/unit/src/unit/issues/Issue11888.hx | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/unit/src/unit/issues/Issue11888.hx diff --git a/std/lua/_lua/_hx_bit.lua b/std/lua/_lua/_hx_bit.lua index 0eef3f32479..549742ca635 100644 --- a/std/lua/_lua/_hx_bit.lua +++ b/std/lua/_lua/_hx_bit.lua @@ -19,3 +19,4 @@ end _hx_bit.bor = function(...) return _hx_bit_clamp(_hx_bit_raw.bor(...)) end _hx_bit.band = function(...) return _hx_bit_clamp(_hx_bit_raw.band(...)) end _hx_bit.arshift = function(...) return _hx_bit_clamp(_hx_bit_raw.arshift(...)) end +_hx_bit.lshift = function(...) return _hx_bit_clamp(_hx_bit_raw.lshift(...)) end \ No newline at end of file diff --git a/tests/unit/src/unit/issues/Issue11888.hx b/tests/unit/src/unit/issues/Issue11888.hx new file mode 100644 index 00000000000..febd0004428 --- /dev/null +++ b/tests/unit/src/unit/issues/Issue11888.hx @@ -0,0 +1,11 @@ +package unit.issues; + +import haxe.Int64; + +class Issue11888 extends unit.Test { + public function test() { + var n:Int64 = Int64.make(0,-1); + var result:Int64 = Int64.shl(n,1); + eq(-2, result.low); + } +}