HaxeFoundation / HaxeFoundation/haxe

@:structInit vs new optional var syntax

Open
#7,183 7 comments 2 reactions 1 assignee Claimed by @RealyUniqueName View on GitHub
feature-structInit
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
@:structInit
class Person {
var ?name:String;
}
```

```
src/Main.hx:3: characters 7-11 : ?var syntax is only allowed in structures
```

I think `@:structInit` classes also support the notion of `@:optional` fields, so the new syntax should be supported too?

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.