Skip to content

Standard-library metadata is lost when a standard-library table is assigned to a local #675

Description

@nurpax

Repro

zig.yml

globals:
  z2.ecs.create_entity:
    args: []
    must_use: true

selene.toml

std = "zig"

repro.lua

local ecs = z2.ecs
local e = ecs.create_entity(3) -- `z2.ecs.create_entity` requires 0 parameters and 1 was passed

Expected behavior

Selene should report something like: Selene should report that z2.ecs.create_entity requires 0 parameters and 1 was passed (because ecs is just a local alias of z2.ecs.)

This applies to standard-library definitions, including libraries that I define in my own yml files.

What actually happens

No standard-library warning is reported once the table is assigned to a local:

local ecs = z2.ecs
local e = ecs.create_entity(3)

The direct form does warn:

local e = z2.ecs.create_entity(3)

Suggested fix

I'm working on a PR for this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions