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

Check to enforce or disallow array access on Map #230

Open
Gama11 opened this issue Mar 31, 2016 · 3 comments
Open

Check to enforce or disallow array access on Map #230

Gama11 opened this issue Mar 31, 2016 · 3 comments

Comments

@Gama11
Copy link
Member

Gama11 commented Mar 31, 2016

There's two ways of using maps in Haxe, with array access or get() / set(). People might want to enforce one of these styles (I prefer array access for example).

class Test {
    static function main() {
        var map = ["a" => "b"];
        map["a"] = "c";
        trace(map["a"]);
    }
}

vs.

class Test {
    static function main() {
        var map = ["a" => "b"];
        map.set("a", "c");
        trace(map.get("a"));
    }
}
@adireddy
Copy link
Member

adireddy commented Apr 1, 2016

What should be the name of this check?

MapAccessCheck?

Part of coding package?

@Gama11
Copy link
Member Author

Gama11 commented Apr 1, 2016

Both of that seems sensible. :)

@adireddy
Copy link
Member

adireddy commented Apr 1, 2016

👍

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

No branches or pull requests

2 participants