Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error for list in list #69

Closed
buildersbrewery opened this issue Jan 2, 2018 · 5 comments
Closed

Show error for list in list #69

buildersbrewery opened this issue Jan 2, 2018 · 5 comments

Comments

@buildersbrewery
Copy link

lslint should report an error for:

default
{
    state_entry()
    {
        list items = [(list)1];
        llSay(PUBLIC_CHANNEL, llList2CSV(items));
    }
}

Suggestion:

  • check for explicit casts to list
  • check for functions that return a list

SL behavior:

  • script compiles, but crashes

Tested with v1.0.8.

@Sei-Lisa
Copy link

Sei-Lisa commented Jan 2, 2018

This looks like a dup of #36.

@Sei-Lisa
Copy link

Sei-Lisa commented Jan 3, 2018

Can you clarify this, please?

  • check for explicit casts to list
  • check for functions that return a list

My understanding is that the situation to catch is a list constructor [ ... ] containing any element of type list, isn't that so? For example, this should also be caught:

    list a;
    list b = [a];

@buildersbrewery
Copy link
Author

That too, yes.

@buildersbrewery
Copy link
Author

Catching that and user-defined functions that return lists would require keeping track of variable and function types, though.

It's a bit easier to catch if there's an explicit cast to list or a built-in function that returns a list.

@Sei-Lisa
Copy link

Sei-Lisa commented Jan 3, 2018

Catching that and user-defined functions that return lists would require keeping track of variable and function types, though.

The good news is that lslint already does that :)

I have a patch ready. I'll submit it soon.

Makopo pushed a commit that referenced this issue Jan 3, 2018
Applies to list constants and list constructors where one of the elements is of type list.

Closes #36, with the difference that it's an error instead of a warning as suggested in #69.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants