Skip to content

Commit

Permalink
Merge branch 'development' into dev-hlfdiv32
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Mar 4, 2025
2 parents 0989bd7 + 78c2598 commit 9fa8ecb
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:


linux-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
OPAMYES: 1
Expand All @@ -123,7 +123,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}-1

- name: Install Neko from S3
run: |
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:

linux-test:
needs: linux-build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
TEST: ${{matrix.target}}
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:

test-docgen:
needs: linux-build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
HXCPP_COMPILE_CACHE: ~/hxcache
Expand Down Expand Up @@ -854,7 +854,7 @@ jobs:
deploy:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64-test, mac-test, windows64-test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
# this is only needed for to get `COMMIT_DATE`...
# maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
Expand Down Expand Up @@ -924,7 +924,7 @@ jobs:
deploy_apidoc:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64-test, mac-test, windows64-test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ NEKO_VERSION_TAG=v$(shell echo "$(NEKO_VERSION)" | sed "s/\./-/g")
all: haxe tools

haxe:
dune build --profile release src/haxe.exe
cp -f _build/default/src/haxe.exe ./"$(HAXE_OUTPUT)"
dune build --profile release

plugin: haxe
$(DUNE_COMMAND) build --profile release plugins/$(PLUGIN)/$(PLUGIN).cmxs
Expand Down Expand Up @@ -234,7 +233,7 @@ package_installer_mac: $(INSTALLER_TMP_DIR)/neko-osx.tar.gz package_unix
clean: clean_haxe clean_tools clean_package

clean_haxe:
rm -f -r _build $(HAXE_OUTPUT) $(PREBUILD_OUTPUT)
dune clean

clean_tools:
rm -f $(HAXE_OUTPUT) $(PREBUILD_OUTPUT) $(HAXELIB_OUTPUT)
Expand Down
7 changes: 7 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
(dirs src libs)
(data_only_dirs src-json)

(rule
(action
(copy src/haxe.exe haxe%{ext_exe}))
(mode
(promote (until-clean)))
(alias default))
12 changes: 6 additions & 6 deletions extra/github-actions/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
@import build-windows.yml

linux-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
OPAMYES: 1
Expand All @@ -42,7 +42,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}
key: ${{ runner.os }}-${{ matrix.ocaml }}-${{ hashFiles('./haxe.opam', './libs/') }}-1

@import install-neko-unix.yml

Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:

linux-test:
needs: linux-build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
TEST: ${{matrix.target}}
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:

test-docgen:
needs: linux-build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PLATFORM: linux64
HXCPP_COMPILE_CACHE: ~/hxcache
Expand Down Expand Up @@ -478,7 +478,7 @@ jobs:
deploy:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64-test, mac-test, windows64-test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
# this is only needed for to get `COMMIT_DATE`...
# maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
Expand Down Expand Up @@ -548,7 +548,7 @@ jobs:
deploy_apidoc:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64-test, mac-test, windows64-test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
Expand Down
5 changes: 4 additions & 1 deletion src/typing/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,9 @@ let type_unop ctx op flag e with_type p =
| AKAccess(a,tl,c,ebase,ekey) ->
begin try
(match op with Increment | Decrement -> () | _ -> raise Not_found);
let v_base = alloc_var VGenerated "tmp" ebase.etype ebase.epos in
let evar_base = mk (TVar(v_base, Some ebase)) ctx.com.basic.tvoid ebase.epos in
let ebase = mk (TLocal v_base) ebase.etype ebase.epos in
let v_key = alloc_var VGenerated "tmp" ekey.etype ekey.epos in
let evar_key = mk (TVar(v_key,Some ekey)) ctx.com.basic.tvoid ekey.epos in
let ekey = mk (TLocal v_key) ekey.etype ekey.epos in
Expand All @@ -998,7 +1001,7 @@ let type_unop ctx op flag e with_type p =
let e_op = mk (TBinop((if op = Increment then OpAdd else OpSub),ev_get,e_one)) ev_get.etype p in
(* set *)
let e_set = mk_array_set_call ctx (AbstractCast.find_array_write_access_raise ctx a tl ekey e_op p) c ebase p in
let el = evar_key :: evar_get :: e_set :: (if flag = Postfix then [ev_get] else []) in
let el = evar_base :: evar_key :: evar_get :: e_set :: (if flag = Postfix then [ev_get] else []) in
mk (TBlock el) e_set.etype p
with Not_found ->
let e = mk_array_get_call ctx (AbstractCast.find_array_read_access ctx a tl ekey p) c ebase p in
Expand Down
21 changes: 21 additions & 0 deletions tests/misc/cpp/projects/Issue12027/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function main() {
foo(new Foo());
}

function foo(foo:Null<Foo>) {
(foo ?? throw "hello")[0]++;
}

abstract Foo(Int) {
public function new() {
this = 0;
}

@:op([]) function get(i:Int) {
return this;
}

@:op([]) function set(i:Int, val:Int) {
return this;
}
}
2 changes: 2 additions & 0 deletions tests/misc/cpp/projects/Issue12027/compile.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-m Main
-cpp out

0 comments on commit 9fa8ecb

Please sign in to comment.