Skip to content

Adding some properties causes linter to give me 260 errors across my files. #2736

Description

@koeqaife

I wish there was a good issue template, but seems like no.

So I will try to include everything I have discovered and everything I think may be useful.

Types I use:
Types.zip

Had to put them in .zip because github doesn't let to upload .lua or .luau files

It causes errors in every single file that imports Widget.luau so I don't think I have to include files unless it's gonna be impossible to reproduce the error.

All the errors:
errors.txt

It just put error on every single thing and I had my 2 whole files red.

And I noticed that error disappears if I remove these two lines from Widget.Interface type:

    setModifier: <K>(name: K & keyof<Modifier.Modifiers>, params: index<Modifier.Modifiers, K>) -> (),
    getModifier: <K>(name: K & keyof<Modifier.Components>) -> index<Modifier.Components, K>,

Also removing these 4 lines from Modifier.Component makes errors disappear too:

    read setProperty: <K>(key: K & KeyOf<Props>, value: NonNil<Resolve<Props, K>> | Ref.Instance<NonNil<Resolve<Props, K>>>) -> (),
    read snapProperty: <K>(key: K & KeyOf<Props>, value: NonNil<Resolve<Props, K>> | Ref.Instance<NonNil<Resolve<Props, K>>>) -> (),
    read getProperty: <K>(key: K & KeyOf<Props>) -> NonNil<Resolve<Props, K>>,
    read observe: <K>(key: K & KeyOf<Props>, callback: (newValue: NonNil<Resolve<Props, K>>) -> ()) -> (() -> ()),

Even one line of any produces errors.

Any of these is very important to me and putting type any would make a lot of stuff useless.

Also note: I have tried removing any type function and using keyof and index instead of KeyOf and Resolve functions, so problem is not in functions. And I use these two because keyof and index work poorly with my types and I have to do "property" :: "property" to get singletones.

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

    analysisThis is an issue related to type inferencebugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions