HaxeFoundation / HaxeFoundation/haxe

Type Inference + recursive call doesn't play well

Open
#6,560 8 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

```haxe
class Test {
static function main() {
function foo (a:F):Array {
return if (a == null) [] else foo(a);
}
var bar:Array = foo(1);
}
}
```
results in the following error:
```
Test.hx:6: characters 27-28 : Int should be foo.F
Test.hx:6: characters 27-28 : For function argument 'a'
```
http://try-haxe.mrcdk.com/#55350

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.