HaxeFoundation / HaxeFoundation/haxe

Uncaught exception field access on null

Open
#10,902 3 comments 0 reactions 1 assignee Claimed by @Simn View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

I have Murmur3 hash implementation with such in the begining:

```Haxe
class Murmur3 {
private static final seed:Int64 = Int64.fromFloat(0);
private static final C1:Int64 = Int64.fromFloat(0xcc9e2d51);
private static final C2:Int64 = Int64.fromFloat(0x1b873593);
```

Unfortunately, when I try to access these fields, they are null and I get an error:

```
src/lang/Murmur3.hx:110: characters 3-11 : Uncaught exception field access on null
...
```

I run it with `--interp`.

I don't know how that can be, and that is really strange, because when I try to make simple example to reproduce the error - it works.

Maybe it happens only in my project, because there are many classes, inheritance etc or somehow related to math operations in cache algorithm, because of some mix with Int and Int64. At least Haxe doesn't provide any message when writing:

```Haxe
private static final C1:Int = 0xcc9e2d51;
```

But if write:

```Haxe
private static final C1:Int = 3432918353
```

There is: "Float should be Int".

But even if I replace Int64 with `Int` with simple values like 0 or 1, I still have such error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.