[cs] operand of an increment must be variable #5915

Open
ibilon opened this Issue Dec 30, 2016 · 0 comments

Projects

None yet

2 participants

@ibilon
Member
ibilon commented Dec 30, 2016

This code:

enum A {
    A1(v:String);
    A2(v:B);
}
enum B {
    BB(v:Float);
}
class Test {
    public static function main () {
        var v1 = A2(BB(12));
        v1 = switch (v1) {
            case A2(v):
                switch (v) {
                    case BB(v): A2(BB(v++));
                }
            default: A1("");
        }
        trace(v1);
    }
}

doesn't pass native c# compilation and fails with:

src/Test.cs(82,127): error CS1059: The operand of an increment or decrement operator must be a variable, property or indexer

the line in Test.cs:

v1 = global::A.A2(global::B.BB(((double) (global::haxe.lang.Runtime.toDouble(((global::B) (v1.@params[0]) ).@params[0])) )++));
@Simn Simn modified the milestone: 4.0 Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment