HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 656 forks source link

4.3.4 #11583

Closed kLabz closed 7 months ago

kLabz commented 7 months ago

[!warning] This is to be merged to 4.3_bugfix (do not squash!)

Backported bugfixes from 4.3 Hotfix Candidates

Update -D haxe-next behavior

Start applying some haxe 5 behavior:

kLabz commented 7 months ago

Regarding the bind change:

function f(notOpt:Int, ?opt:String) {}
function g(notOpt:Int, alsoNotOpt:Bool, ?opt:String) {}

function main() {
    var fBind = f.bind(1);
    var gBind = g.bind(1);
    $type(fBind);
    $type(gBind);

    var fBind = f.bind(1, _);
    $type(fBind);

    var f1 = f.bind(1, null);
    $type(f1);

    var g1 = g.bind(1, _, null);
    $type(g1);
}

Gives:

# 5.0.0 nightlies
src/Main.hx:7: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:8: characters 8-13 : Warning : (alsoNotOpt : Bool, ?opt : Null<String>) -> Void
src/Main.hx:11: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:14: characters 8-10 : Warning : () -> Void
src/Main.hx:17: characters 8-10 : Warning : (alsoNotOpt : Bool) -> Void

# 4.3.3
src/Main.hx:7: characters 8-13 : Warning : () -> Void
src/Main.hx:8: characters 8-13 : Warning : (alsoNotOpt : Bool) -> Void
src/Main.hx:11: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:14: characters 8-10 : Warning : () -> Void
src/Main.hx:17: characters 8-10 : Warning : (alsoNotOpt : Bool) -> Void

# 4.3.4 nightlies
src/Main.hx:7: characters 8-13 : Warning : () -> Void
src/Main.hx:8: characters 8-13 : Warning : (alsoNotOpt : Bool) -> Void
src/Main.hx:11: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:14: characters 8-10 : Warning : () -> Void
src/Main.hx:17: characters 8-10 : Warning : (alsoNotOpt : Bool) -> Void

# 4.3.4 nightlies with -D haxe-next
src/Main.hx:7: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:8: characters 8-13 : Warning : (alsoNotOpt : Bool, ?opt : Null<String>) -> Void
src/Main.hx:11: characters 8-13 : Warning : (?opt : Null<String>) -> Void
src/Main.hx:14: characters 8-10 : Warning : () -> Void
src/Main.hx:17: characters 8-10 : Warning : (alsoNotOpt : Bool) -> Void
kLabz commented 7 months ago

(disregard the branch name, this branch is pretty much about all changes between 4.3.3 and 4.3.4 now)

I've added some changes that I thought we might want to add in addition to the ones tracked in #11394:

I can obviously remove some/all from here if that's an issue.

There are also a few more changes that I didn't add (yet), for which there are conflicts / I have some doubts / there is still some work to do:

As for -D haxe-next, I'm not sure what can be done about Rework module resolution #11168 ; any idea?

RblSb commented 7 months ago

Would like to have https://github.com/HaxeFoundation/haxe/commit/03aa20efb678e02768c4a25afbf4d69ac4ee11d9, change seems pretty small?

kLabz commented 7 months ago

Already cited above