HaxeFoundation / HaxeFoundation/haxe

Weird implicit cast hangs the compiler in pattern matching.

Open
#10,082 2 comments 0 reactions 1 assignee Claimed by @Simn View on GitHub
bug feature-pattern-matching
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Test {
static function main() {
final v = new Vector([1, 2]);
switch v {
case [1,2]: true;
case _: false;
}
}
}

abstract Vector(Array) {
public inline function new(a)
this = a;
@:from static function fromVector(v:Vector):Vector
return cast v;
}
```

Compiler seems to be stuck in a loop. From https://github.com/haxetink/tink_pure/issues/18

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.