HaxeFoundation / HaxeFoundation/haxe

type parameters and void/dynamic unification

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

Not sure if bug, or what to think of it. This worked in 4.2.1, now it errors.

I would expect either both variants to work, or both to error.

```haxe
function main() {
var a:Gen = new Gen(new Foo());
var b = new Gen(new Foo());
var aa:Gen = a; // Works.
var bb:Gen = b; // Error: Void should be Dynamic
}
class Gen {
final ser:A;
public function new(ser:S) this.ser = ser;
}
typedef FooDynamic = {function foo():Dynamic;}
typedef FooVoid = {function foo():Void;}
class Foo {
public function foo():Void {};
public function new() {}
}
```

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.