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

[cs/java] switch in loop with break #6267

Closed
Gama11 opened this issue May 12, 2017 · 0 comments
Closed

[cs/java] switch in loop with break #6267

Gama11 opened this issue May 12, 2017 · 0 comments

Comments

@Gama11
Copy link
Member

Gama11 commented May 12, 2017

This doesn't compile to C# or Java, breaking hxtemplo on these targets. Compiles fine with 3.4.2 though, so it's a regression.

import haxe.ds.Option;

class Main {
	static function main() {
		var o:Option<Int> = None;
		while (true) {
			switch (o) {
				case Some(_): [].push({e: Some(0)});
				case None: break;
				case _:
			}
		}
	}
}

C#:

Main.hx(8,54): error CS1525: Ungültiger Ausdruck '{'.
\Main.hx(8,55): error CS1026: ) erwartet.
Main.hx(8,55): error CS1002: ; erwartet.
Main.hx(10,7): error CS1525: Ungültiger Ausdruck ')'.
Main.hx(12,6): error CS1525: Ungültiger Ausdruck 'case'.
Main.hx(12,12): error CS1002: ; erwartet.
Main.hx(12,12): error CS1525: Ungültiger Ausdruck ':'.
Main.hx(12,13): error CS1002: ; erwartet.
Main.hx(16,15): error CS1514: { erwartet.
Main.cs(64,2): error CS1525: Ungültiger Ausdruck '}'.
Main.cs(64,3): error CS1002: ; erwartet.

Java:

src\haxe\root\Main.java:49: error: illegal start of expression
{
^
src\haxe\root\Main.java:49: error: ';' expected
{
^
src\haxe\root\Main.java:51: error: illegal start of expression
haxe.ds.Option __temp_odecl1 = haxe.ds.Option.Some(0);
^
src\haxe\root\Main.java:51: error: ';' expected
haxe.ds.Option __temp_odecl1 = haxe.ds.Option.Some(0);
^
src\haxe\root\Main.java:55: error: illegal start of expression
);
^
src\haxe\root\Main.java:61: error: orphaned case
case 1:
^
src\haxe\root\Main.java:75: error: class, interface, or enum expected
}

Haxe version: e0a28b3

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