Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.3.4 #11583

Merged
merged 35 commits into from
Mar 4, 2024
Merged

4.3.4 #11583

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6151a2c
[jvm] warn about --java ... -D jvm vs --jvm ...
kLabz Feb 13, 2024
bd1a09e
[ci] lock utest version to pre-2.0
kLabz Dec 16, 2023
39b45e2
[ci] update dependencies
kLabz Feb 13, 2024
fc1bfcb
[macro] Build order vs inheritance (#11582)
kLabz Feb 16, 2024
05efbc2
[tests] misc tests: ignore position changes for std modules
kLabz Feb 3, 2024
69f8b4e
[tests] improve std position hiding a bit
kLabz Feb 3, 2024
8a2af71
[tests] well ofc there's windows too..
kLabz Feb 4, 2024
1486aef
[tests] need to escape those slashes on windows
kLabz Feb 4, 2024
91761ef
[tests] remove test with pretty errors that brings nothing but pain
kLabz Feb 3, 2024
29d6174
Deprecate some API from haxe.macro.Compiler
kLabz Feb 3, 2024
2211715
Dont infer string on concat (#11318)
Simn Nov 7, 2023
db5944b
[typer] don't type trailing optional bind arguments so weirdly (#11533)
Simn Feb 1, 2024
213a361
[hl/c] fix reserved keywords (#11408)
kLabz Nov 23, 2023
9d9d501
[parser] remove strange Error catching
Simn Nov 21, 2023
1a0ca93
[analyzer] deal with unreachable block in binops
Simn Nov 22, 2023
5212409
[analyzer] don't recursively check enum values when const propagating
Simn Dec 14, 2023
2f4b795
[typer] remove Directory package rule because it is unused
Simn Jan 9, 2024
f625925
don't double-throw all exceptions
Simn Feb 6, 2024
0db96b0
[matcher] follow when looking for GADT return types
Simn Dec 24, 2023
693de89
[analyzer] fix check for inlined purity meta
Simn Nov 19, 2023
30f8b1f
fix JsonPrinter empty parent class
Simn Feb 7, 2024
d4638b5
avoid JS test problem
Simn Feb 7, 2024
a78c614
allow `@:using` with Class and Enum (#11553)
Simn Feb 7, 2024
2dcf037
[dce] clean up operator handling
Simn Dec 13, 2023
95fafa7
[display] expose list of metadata/defines (#11399)
kLabz Nov 21, 2023
2d766de
[typer] don't hide abstract type when resolving through @:forward
Simn Jan 30, 2024
04c0fc1
add @:forward.accessOnAbstract and use it for cs.PointerAccess
Simn Jan 31, 2024
999a6d6
Revert @:forward.accessOnAbstract, hack instead
Simn Jan 31, 2024
ffe5711
dodge c# static type param problem
Simn Jan 31, 2024
7517ebc
[tests] Mac cppia isn't happy there for some reason
kLabz Feb 19, 2024
09d1bad
[hl] hlopt rework try-catch control flow (#11581)
yuxiaomao Feb 26, 2024
048c517
[display] deal with static extension hovers properly
Simn Aug 31, 2023
3f9472e
[display inspect generated expression when displaying safe-nav
Simn Nov 18, 2023
00faf0f
update changelog
kLabz Mar 4, 2024
847bb02
Release 4.3.4
kLabz Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ jobs:
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

- name: Build xmldoc
if: matrix.ocaml == '4.08.1'
run: |
set -ex
make -s xmldoc
Expand Down Expand Up @@ -615,7 +616,7 @@ jobs:
- name: Install dependencies
env:
# For compatibility with macOS 10.13
ZLIB_VERSION: 1.3
ZLIB_VERSION: 1.3.1
MBEDTLS_VERSION: 2.28.5
PCRE2_VERSION: 10.42
run: |
Expand All @@ -631,7 +632,7 @@ jobs:
brew install cpanminus
cpanm IPC::System::Simple
cpanm String::ShellQuote
curl -L https://www.zlib.net/zlib-$ZLIB_VERSION.tar.gz | tar xz
curl -L https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz | tar xz
cd zlib-$ZLIB_VERSION
./configure
make && make install
Expand Down
31 changes: 31 additions & 0 deletions extra/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
2024-03-04 4.3.4

General improvements:

all : allow @:using with Class and Enum (#11553)
display : expose list of metadata/defines (#11399)

Bugfixes:

all : typedef vs. GADT (#11446)
all : don't double-throw exceptions (#11175)
all : fix some abstract inlining failures (#11526)
all : fix JsonPrinter empty parent class (#11560)
all : dce: clean up operator handling (#11427)
all : analyzer: deal with unreachable block in binops (#11402)
all : analyzer: don't recursively check enum values when const propagating (#11429)
all : analyzer: fix check for inlined purity meta
display : fix errors from parser missing in diagnostics (#8687)
display : fix display services with static extension (#11285)
display : fix display services with safe navigation (#11205)
hl : hlopt rework try-catch control flow (#11581)
hl/c : fix reserved keywords (#11408)

Deprecation / future version handling:

all : don't infer string on concat, when using -D haxe-next (#11318)
all : handle optional arguments with bind, when using -D haxe-next (#11533)
macro : build order vs inheritance, when using -D haxe-next (#11582)
macro : deprecate some API from haxe.macro.Compiler (see #11540)
java/jvm : warn about --java ... -D jvm vs --jvm ...

2023-09-17 4.3.3

General improvements:
Expand Down
6 changes: 3 additions & 3 deletions haxe.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "haxe"
version: "4.3.3"
version: "4.3.4"
synopsis: "Multi-target universal programming language"
description: """
Haxe is an open source toolkit based on a modern,
Expand All @@ -20,7 +20,7 @@ install: [make "install" "INSTALL_DIR=%{prefix}%"]
remove: [make "uninstall" "INSTALL_DIR=%{prefix}%"]
depends: [
("ocaml" {>= "5.0"} & ("camlp5" {build}))
| ("ocaml" {>= "4.08" & < "5.0"} & ("camlp5" {build & = "8.00"}))
| ("ocaml" {>= "4.08" & < "5.0"} & ("camlp5" {build & = "8.00.03"}))
"ocamlfind" {build}
"dune" {>= "1.11"}
"sedlex" {>= "2.0"}
Expand All @@ -32,5 +32,5 @@ depends: [
"conf-libpcre2-8"
"conf-zlib"
"conf-neko"
"luv"
"luv" {= "0.5.12"}
]
12 changes: 12 additions & 0 deletions src-prebuild/prebuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,18 @@ let parse_meta_usage = function
| \"TVariable\" -> TVariable
| t -> raise (failwith (\"invalid metadata target \" ^ t))

let print_meta_usage = function
| TClass -> \"TClass\"
| TClassField -> \"TClassField\"
| TAbstract -> \"TAbstract\"
| TAbstractField -> \"TAbstractField\"
| TEnum -> \"TEnum\"
| TTypedef -> \"TTypedef\"
| TAnyField -> \"TAnyField\"
| TExpr -> \"TExpr\"
| TTypeParameter -> \"TTypeParameter\"
| TVariable -> \"TVariable\"

type meta_parameter =
| HasParam of string
| Platforms of platform list
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let process_args arg_spec =

let parse_args com =
let usage = Printf.sprintf
"Haxe Compiler %s - (C)2005-2023 Haxe Foundation\nUsage: haxe%s <target> [options] [hxml files and dot paths...]\n"
"Haxe Compiler %s - (C)2005-2024 Haxe Foundation\nUsage: haxe%s <target> [options] [hxml files and dot paths...]\n"
s_version_full (if Sys.os_type = "Win32" then ".exe" else "")
in
let actx = {
Expand Down Expand Up @@ -158,7 +158,7 @@ let parse_args com =
let all,max_length = Define.get_user_documentation_list com.user_defines in
let all = List.map (fun (n,doc) -> Printf.sprintf " %-*s: %s" max_length n (limit_string doc (max_length + 3))) all in
List.iter (fun msg -> com.print (msg ^ "\n")) all;
exit 0
raise Abort
)
),"","print help for all user defines");
("Miscellaneous",["--help-metas"],[], Arg.Unit (fun() ->
Expand All @@ -173,7 +173,7 @@ let parse_args com =
let all,max_length = Meta.get_user_documentation_list com.user_metas in
let all = List.map (fun (n,doc) -> Printf.sprintf " %-*s: %s" max_length n (limit_string doc (max_length + 3))) all in
List.iter (fun msg -> com.print (msg ^ "\n")) all;
exit 0
raise Abort
)
),"","print help for all user metadatas");
] in
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/displayOutput.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ let print_fields fields =
| ITPackage(path,_) -> "package",snd path,"",None
| ITModule path -> "type",snd path,"",None
| ITMetadata meta ->
let s,(doc,_),_ = Meta.get_info meta in
"metadata","@" ^ s,"",doc_from_string doc
let s,data = Meta.get_info meta in
"metadata","@" ^ s,"",doc_from_string data.m_doc
| ITTimer(name,value) -> "timer",name,"",doc_from_string value
| ITLiteral s ->
let t = match k.ci_type with None -> t_dynamic | Some (t,_) -> t in
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ let generate ctx tctx ext actx =
| Cs ->
Gencs.generate,"cs"
| Java ->
if Common.defined com Jvm then
if Common.defined com Jvm then begin
com.warning WDeprecated com.warning_options ("--java out.jar -D jvm is deprecated; use --jvm out.jar directly") null_pos;
Genjvm.generate actx.jvm_flag,"java"
else
end else
Genjava.generate,"java"
| Python ->
Genpy.generate,"python"
Expand Down
1 change: 0 additions & 1 deletion src/context/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ open Warning

type package_rule =
| Forbidden
| Directory of string
| Remap of string

type pos = Globals.pos
Expand Down
29 changes: 24 additions & 5 deletions src/context/display/displayFields.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,31 @@ let collect_static_extensions ctx items e p =
| _ ->
let items = loop items ctx.m.module_using in
let items = loop items ctx.g.global_using in
let items = try
let mt = module_type_of_type e.etype in
loop items (t_infos mt).mt_using
with Exit ->
items
let rec loop_module_using items t = match follow_without_type t with
| TInst(c,_) ->
loop items c.cl_using
| TEnum(en,_) ->
loop items en.e_using
| TType(td,tl) ->
let items = loop items td.t_using in
loop_module_using items (apply_typedef td tl)
| TAbstract(a,_) ->
loop items a.a_using
| TAnon an ->
begin match !(an.a_status) with
| Statics c ->
loop items c.cl_using
| EnumStatics en ->
loop items en.e_using
| AbstractStatics a ->
loop items a.a_using
| _ ->
items
end
| _ ->
items
in
let items = loop_module_using items e.etype in
items

let collect ctx e_ast e dk with_type p =
Expand Down
65 changes: 65 additions & 0 deletions src/context/display/displayJson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,71 @@ let handler =
hctx.display#set_display_file (hctx.jsonrpc#get_bool_param "wasAutoTriggered") true;
hctx.display#enable_display DMSignature
);
"display/metadata", (fun hctx ->
let include_compiler_meta = hctx.jsonrpc#get_bool_param "compiler" in
let include_user_meta = hctx.jsonrpc#get_bool_param "user" in

hctx.com.callbacks#add_after_init_macros (fun () ->
let all = Meta.get_meta_list hctx.com.user_metas in
let all = List.filter (fun (_, (data:Meta.meta_infos)) ->
match data.m_origin with
| Compiler when include_compiler_meta -> true
| UserDefined _ when include_user_meta -> true
| _ -> false
) all in

hctx.send_result (jarray (List.map (fun (t, (data:Meta.meta_infos)) ->
let fields = [
"name", jstring t;
"doc", jstring data.m_doc;
"parameters", jarray (List.map jstring data.m_params);
"platforms", jarray (List.map (fun p -> jstring (platform_name p)) data.m_platforms);
"targets", jarray (List.map (fun u -> jstring (Meta.print_meta_usage u)) data.m_used_on);
"internal", jbool data.m_internal;
"origin", jstring (match data.m_origin with
| Compiler -> "haxe compiler"
| UserDefined None -> "user-defined"
| UserDefined (Some o) -> o
);
"links", jarray (List.map jstring data.m_links)
] in

(jobject fields)
) all))
)
);
"display/defines", (fun hctx ->
let include_compiler_defines = hctx.jsonrpc#get_bool_param "compiler" in
let include_user_defines = hctx.jsonrpc#get_bool_param "user" in

hctx.com.callbacks#add_after_init_macros (fun () ->
let all = Define.get_define_list hctx.com.user_defines in
let all = List.filter (fun (_, (data:Define.define_infos)) ->
match data.d_origin with
| Compiler when include_compiler_defines -> true
| UserDefined _ when include_user_defines -> true
| _ -> false
) all in

hctx.send_result (jarray (List.map (fun (t, (data:Define.define_infos)) ->
let fields = [
"name", jstring t;
"doc", jstring data.d_doc;
"parameters", jarray (List.map jstring data.d_params);
"platforms", jarray (List.map (fun p -> jstring (platform_name p)) data.d_platforms);
"origin", jstring (match data.d_origin with
| Compiler -> "haxe compiler"
| UserDefined None -> "user-defined"
| UserDefined (Some o) -> o
);
"deprecated", jopt jstring data.d_deprecated;
"links", jarray (List.map jstring data.d_links)
] in

(jobject fields)
) all))
)
);
"server/readClassPaths", (fun hctx ->
hctx.com.callbacks#add_after_init_macros (fun () ->
let cc = hctx.display#get_cs#get_context (Define.get_signature hctx.com.defines) in
Expand Down
2 changes: 0 additions & 2 deletions src/context/display/displayPath.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module TypePathHandler = struct
| x :: l ->
(try
match PMap.find x com.package_rules with
| Directory d -> d :: l
| Remap s -> s :: l
| _ -> p
with
Expand All @@ -47,7 +46,6 @@ module TypePathHandler = struct
match PMap.find f com.package_rules with
| Forbidden -> ()
| Remap f -> packages := f :: !packages
| Directory _ -> raise Not_found
with Not_found ->
packages := f :: !packages
else
Expand Down
1 change: 0 additions & 1 deletion src/context/display/displayToplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class explore_class_path_task com checked recursive f_pack f_module dir pack = o
begin try
begin match PMap.find file com.package_rules with
| Forbidden | Remap _ -> ()
| _ -> raise Not_found
end
with Not_found ->
f_pack (List.rev pack,file);
Expand Down
5 changes: 4 additions & 1 deletion src/context/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,13 @@ let get_next_stored_typed_expr_id =
let uid = ref 0 in
(fun() -> incr uid; !uid)

let make_stored_id_expr id p =
(EConst (Int (string_of_int id, None))), p

let store_typed_expr com te p =
let id = get_next_stored_typed_expr_id() in
com.stored_typed_exprs#add id te;
let eid = (EConst (Int (string_of_int id, None))), p in
let eid = make_stored_id_expr id p in
id,((EMeta ((Meta.StoredTypedExpr,[],null_pos), eid)),p)

let push_this ctx e = match e.eexpr with
Expand Down
Loading
Loading