HaxeFoundation / HaxeFoundation/haxe

`() -> Void` should be haxe.Function

Open
#10,554 2 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

https://try.haxe.org/#FeD45a50
```haxe
import haxe.Constraints.Function;

class Test {
static function main() {
trace("Haxe is great!");
}
}

enum abstract Events(Event) {
var Sleep = new Event<() -> Void>(0);
}

abstract Event(Int) {
public inline function new(name) {
this = name;
}
}
```
Error:
```
Test.hx:10: characters 14-38 : error: () -> Void should be haxe.Function
Test.hx:10: characters 14-38 : ... have: Event<() -> ...>
Test.hx:10: characters 14-38 : ... want: Event
```
(After playing with typed listener example from [code.haxe.org](https://code.haxe.org/category/abstract-types/abstracts-with-type-params.html))

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.