Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Created October 30, 2015 23:15
Show Gist options
  • Save lucaswerkmeister/8828e59d199decab2ac9 to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/8828e59d199decab2ac9 to your computer and use it in GitHub Desktop.
Additional info for ceylon/ceylon-compiler#2409
@noanno Anything a = print("");
package tmp;
final class a_ {
private a_() {
}
private static final .java.lang.Object value;
private static volatile boolean $init$value = false;
private static final .java.lang.Throwable $initException$;
static {
try {
value = (
let
{
.ceylon.language.print_.print(.ceylon.language.String.instance(""));
}
returning null;
);
$initException$ = null;
$init$value = true;
} catch (.java.lang.Throwable x) {
$initException$ = x;
value = null;
$init$value = false;
}
}
public static .java.lang.Object get_() {
if (a_.$init$value) {
return value;
} else {
if ($initException$ != null) .com.redhat.ceylon.compiler.java.Util.rethrow($initException$);
throw new .ceylon.language.InitializationError("Cyclic initialization trying to read the value of \'a\' before it was set");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment