Skip to content

Optional struct fields not properly annotated #85

Open
@luttje

Description

@luttje

This code:
Image

Results in this error:
Image

Caused by these annotations of the wiki:
Image

A simple fix would be to annotate the fields as optional, e.g:

---@type Entity?
Bullet.Attacker = self

Besides that I'm not sure if the way default values are annotated is prone to more issues. I mean the self in that annotation file is not going to point to anything useful.

Related

  • surface.CreateFont with the FontData struct has the same issue
  • Same for trace functions like util.TraceLine with Trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions