HaxeFoundation / HaxeFoundation/haxe
invalid assignment through `untyped` causes assertion fail
Open
test-needed
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
class Test {
static function main() {
var foo = new Foo();
untyped foo.bar = function() trace('bar');
foo.bar();
}
}
class Foo {
public function new() { }
public inline function bar() trace('foo');
}
```
Results in assertion fail at https://github.com/HaxeFoundation/haxe/blob/f2f4dc15144c8c76597c1ec9dac66a0b23b5dcc7/src/typing/typer.ml#L514-L515
Without untyped it properly gives error message. Should this assertion be changed into error or should it be handled sooner?
Contributor guide
Assessment
This issue has not been assessed yet.