HaxeFoundation / HaxeFoundation/haxe
Compiler not inferring array type correctly in ternary operation
Open
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
Assessment
This issue has not been assessed yet.