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

Add warning for (list)string_var or (list)key_var in LSO #77

Merged
merged 3 commits into from Apr 22, 2018

Conversation

Sei-Lisa
Copy link

This implements the warning suggested in #35.

Here's a test case that triggers it:

default
{
    state_entry()
    {
        key k = llGetObjectName();
        string s = llGetKey();
        list lst =
                   (list)    // $[E20021] could result in a string
                         k;
        lst = lst +
                    (list)         // $[E20021] could result in a key
                          s;
        if (llGetListEntryType(lst, 0) == TYPE_STRING
         && llGetListEntryType(lst, 1) == TYPE_KEY)
        {
            // This is printed!
            llOwnerSay("LSO has weird bugs");
        }
    }
}

If the above script is compiled with Mono mode disabled, it will output "LSO has weird bugs".

Contains also a couple very minor changes which are not worth a PR.

@Sei-Lisa
Copy link
Author

Sorry, I've force-pushed a minor fix (change of the internal name of the warning, and change a comment in the Mono script)

@Makopo Makopo merged commit 27ee114 into Makopo:master Apr 22, 2018
@Sei-Lisa Sei-Lisa deleted the sei-list-string-key-lso branch April 22, 2018 18:28
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

Successfully merging this pull request may close these issues.

None yet

2 participants