HaxeFoundation / HaxeFoundation/haxe
structInit creates a "non-exist" but typeable constructor
Open
error-reporting
feature-structInit
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
class Main{
static function main() {
$type(Foo.new);
}
}
@:structInit
class Foo {
@:optional var foo:Int;
}
```
```
src/Main.hx:3: characters 9-16 : Foo does not have a constructor
src/Main.hx:3: characters 9-16 : Warning : (foo : Null) -> Foo
```
Contributor guide
Assessment
This issue has not been assessed yet.