Released: 2018-06-12
Thank you for choosing Haxe!
Download for your platform and start developing today.
This is a pre-release, the current stable release version is Haxe 3.4.7.
Dear Community,
On behalf of the Haxe Foundation, we are proud to announce the official release of the Haxe 4.0.0-preview.4! It is available along with the changelog at https://haxe.org/download.
As a preview release, it should not be considered stable. However, we appreciate anyone testing this version which will help us with the real Haxe 4 release. Please report any issues here:
https://github.com/HaxeFoundation/haxe/issues.
Thank you very much for your help!
Our focus for this release has been compiler display services. We implemented a new, JSON-RPC-based protocol which is utilized by the vshaxe Visual Studio Code Extension to provide a variety of new features:
override |
Enum abstracts now get the treatment they deserve with a proper enum abstract
syntax. Furthermore, values can now be omitted if the enum abstract is defined over Int or String:
enum abstract MyEnum(String) { var MyValue; // implicit = "MyValue" } enum abstract MyOtherEnum(Int) { var MyValue0; // implicit = 0 var MyValue1; // implicit = 1 var MyValue5 = 5; var MyValue6; // implicit = 6 }
extern
is now recognized as a field-level modifier and can be used instead of @:extern
@:haxe.json
becomes a metadata entry named "haxe.json"var ?x
and final ?x
, meaning the same as @:optional var x
Type1 & Type2
is now a recognized syntax for intersection types. For the time being, it is only supported to merge structures (replacing the { >Type1, >Type2, }
syntax) and for type parameter constraints (replacing T:(Type1, Type2)
which has been removed from the language).See the changelog for more!
New features:
enum abstract
syntax instead of @:enum abstract
(#4282)extern
on fields instead of @:extern
Type1 & Type2
intersection syntax for type parameter constraints and structures (#7127)General improvements and optimizations:
for
loop unrolling (#3784).
, e.g. @:a.b
. This is represented as a string (#3959)this
(#6036)override |
completionvar ?x
and final ?x
parsing in structures (#6947)@:commutative
on non-static abstract functions (#5599)-D source-map
flag to generate source maps in release buildsRemovals:
T:(A, B)
constraint syntaxBugfixes:
@:structInit
classes (#5449)Null<T>
inconsistency in if/ternary expressions (#6955)untyped
and type parameters (#7113)inline
handling (#7155)Standard Library: