HaxeFoundation / HaxeFoundation/haxe

Compiler not inferring array type correctly in ternary operation

Open
#8,013 2 comments 0 reactions 1 assignee Claimed by @Simn View on GitHub
feature-type-inference
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

This can be reproduced with
```haxe
class Test {
static function main() {
var c = Math.random() > 0.5 ? [new Base(), new Sub()] : [new Sub()];
}
}

class Base {
public function new() { }
}

class Sub extends Base {
public function new() { super(); }
}
```
(http://try-haxe.mrcdk.com/#2616f)

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.