ceylon/ceylon-compiler — Issue #224: Incorrect order of statements in class initializer
Author: gavinking
Created: 2011-11-24 04:10:11+00:00
State: open
Labels: BUG

For this input:

class Main() {

print("Classe Main inicializada: "
+ process.milliseconds.string);

Animal animal = Animal("Cachorro");

}

I get the following resulting Java code:

@.com.redhat.ceylon.compiler.metadata.java.Ceylon
class Main {

Main() {
final br.bichos.Animal animal = new br.bichos.Animal(.ceylon.language.String.instance("Cachorro"));
.ceylon.language.print.print(.ceylon.language.String.instance("Classe Main inicializada: ").plus(.ceylon.language.String.instance(.ceylon.language.Integer.instance(.ceylon.language.process.getProcess().getMilliseconds()).toString())));
}

public static void main(.java.lang.String[] args) {
.ceylon.language.process.getProcess().setupArguments(args);
new Main();
}
}

The order of the statements has been reversed.