Null Safety and Array Access

When enabling null safety and accessing a not existing entry of an array.
Null is assigned to a non-nullable variable. Is this expected behavior?
If so, what is the point of null-safety in this case?
I would have expected either an exception is thrown (my preference) or Null<Int> is the return type on array access.

class Test {
  static function main() {
    final values:Array<Int> = [1];
    final value:Int = values[10];
    trace(value); // value is null

See Type array access on Array<T> as Null<T> by RealyUniqueName · Pull Request #6825 · HaxeFoundation/haxe · GitHub and Revert #6825 · Issue #6847 · HaxeFoundation/haxe · GitHub

what a bummer. :frowning:

The more I work with null safety the more I feel like it gives a false sense of security and results in even more surprising runtime errors than not having null safety at all.

Yes, unfortunately it has quite annoying issues currently, but it cannot introduce any new runtime errors because it doesn’t modify generated code.