-
-
Notifications
You must be signed in to change notification settings - Fork 661
Breaking changes in Haxe 3.2.0
-
Xml
has been unified across all targets to have consistent behavior. In particular both the parser and printer now properly deal with entity escaping in attribute values. If you relied on the quirks of the previous parsers you can use them from php/neko/cpp.NativeXml. -
haxe.ds.Vector.get
no longer returnsNull<T>
butT
. This has to be considered when working with non-nullable types on static targets. -
Abstract
@:from
methods no longer have access to the type parameters of the abstract itself. This was a bug in Haxe 3.1.3. -
Recursive abstract
@:arrayAccess
methods now error instead of silently generating an array access expression. -
There was a parser bug which caused
cast (a).b
to be parsed as(cast a).b
instead of the intendedcast ((a).b)
. This has been fixed but might be observed as a regression in rare cases. -
Int64 is an abstract type now. While usage remains mostly the same, it is no longer possible to use any direct run-time reflection on it. We added
Int64.is
which can be used in place ofStd.is(value, Int64)
. -
The parser no longer accepts leading zeroes in integer literals. This has been removed in order to not give the wrong impression about Haxe supporting C's octal notation.
- Shift operations (
<<
,>>
) onUInt
are now typed asUInt
instead ofInt
. If the previous semantics are required the result can be type-hinted back toInt
:(a << b : Int)
- Shift operations (
<<
,>>
) onUInt
are now typed asUInt
instead ofInt
. If the previous semantics are required the result can be type-hinted back toInt
:(a << b : Int)
-
The HTML externs are now generated from a different source. Refer to https://github.com/HaxeFoundation/html-externs#haxe-32-api-migration for an overview.
-
js.Lib.alert()
has been deprecated and will now generate a warning. Please usejs.Browser.alert()
instead. -
js.html.EventListener
now reflects the Event Listener Class, andjs.html.EventTarget
has been updated to accept either ajs.html.EventListener
or ahaxe.Constraints.Function
. In places where you explicitly expected anjs.html.EventListener
before, you should change to expect ahaxe.Constraints.Function
- Static fields can no longer be accessed via Reflect.field on a class instance (see https://github.com/HaxeFoundation/haxe/issues/4107).
-
The status of structure extensions is now
AExtend
instead ofAClosed
. -
Expressions returned from macros no longer have access to private fields. If you're suddenly getting
Cannot access private field
errors, that's probably it. To gain access to private fields, a returned expression should be wrapped in@:privateAccess
metadata (see https://github.com/HaxeFoundation/haxe/issues/3714).
Learn Haxe: Introduction | Manual | API | Try Haxe | Haxe Library Manager | Code Cookbook
Connect: GitHub | Stack Overflow | Forum | Discord | Gitter | Twitter | Facebook