HaxeFoundation / HaxeFoundation/haxe

Array type inference with local function

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

Description

Seems pretty minor, but maybe report is useful (Haxe nightly)
```haxe
class Point {
public function new() {}
public var x = 0;
public var y = 0;
}
class Main {
static function main() {
final points = [];
function foo() points[0].y = 1;
points[0] = new Point();
points[0].x = 1; // { y : Int } has no field x
foo();
}
}
```
Same result with field and function before main:
```haxe
static final points = [];
static function foo() points[0].y = 1;
static function main() {...
```

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.