HaxeFoundation / HaxeFoundation/haxe

[bug/qol?] abstract over map instantiated with `[]` gets typed to an array

Open
#12,362 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```hx
class Test {
static function main() {
var map:Foo = [];
}
}

abstract Foo(Map) from Map {
public function new(value:Map = null) {
this = value ?? [];
}
}
```
This fails to compile however the below works fine

```hx
var map:Map = []
```

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.