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

array.Sort complex function - unable to parse #9

Open
roncli opened this issue Oct 25, 2023 · 0 comments
Open

array.Sort complex function - unable to parse #9

roncli opened this issue Oct 25, 2023 · 0 comments

Comments

@roncli
Copy link

roncli commented Oct 25, 2023

The following code snippet takes the input array and sorts it so that even numbers are first, and then smaller numbers are before larger numbers. It's a minimum repro for a problem I'm having with the VSCode plugin.

        array<int> x = {1, 2, 3};

        x.Sort(function(a, b) {
            if (a % 2 != b % 2) {
                return a % 2 == 0;
            }
            return a < b;
        });

        for (uint i = 0; i < x.Length; ++i) {
            print(x[i]);
        }

Code works great.
image

Problem is, the VSCode plugin complains that it is "unable to parse" on the .Sort function. There's also some pesky red lettering in there.

image

image
(Line 30 is the line the .Sort function is on in my code at the moment)

Is this just a limitation of the plugin, or is there something amiss on my end?

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

1 participant