HaxeFoundation / HaxeFoundation/haxe

[coro?] Some type inference weirdness

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

Description

```haxe
import haxe.coro.Coroutine;

typedef Yield = Coroutine R>;

function create(f:Coroutine -> Void>) {}

function main() {
create(f -> {
var sum = 1;
sum += f(sum); // Float should be Int
});
}
```

I don't know where that `Float` comes from, seems like the compiler defaults to it and then complains about itself.

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.