Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scala pattern matching decompiled - 3
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import RunExample.delayedInit.body;
import scala.App;
import scala.Function0;
import scala.App.class;
import scala.Predef.;
import scala.collection.mutable.ListBuffer;
import scala.math.BigDecimal;
import scala.runtime.BoxedUnit;
public final class RunExample$ implements App {
public static final RunExample$ MODULE$;
private final Object typeTest;
private final long executionStart;
private String[] scala$App$$_args;
private final ListBuffer<Function0<BoxedUnit>> scala$App$$initCode;
static {
new RunExample$();
}
public long executionStart() {
return this.executionStart;
}
public String[] scala$App$$_args() {
return this.scala$App$$_args;
}
public void scala$App$$_args_$eq(String[] x$1) {
this.scala$App$$_args = x$1;
}
public ListBuffer<Function0<BoxedUnit>> scala$App$$initCode() {
return this.scala$App$$initCode;
}
public void scala$App$_setter_$executionStart_$eq(long x$1) {
this.executionStart = x$1;
}
public void scala$App$_setter_$scala$App$$initCode_$eq(ListBuffer x$1) {
this.scala$App$$initCode = x$1;
}
public String[] args() {
return class.args(this);
}
/** @deprecated */
public void delayedInit(Function0<BoxedUnit> body) {
class.delayedInit(this, body);
}
public void main(String[] args) {
class.main(this, args);
}
public Object typeTest() {
return this.typeTest;
}
public final void delayedEndpoint$RunExample$1() {
this.typeTest = "String";
Object var1 = this.typeTest();
BoxedUnit var2;
if(var1 instanceof Integer) {
.MODULE$.println("Integer type");
var2 = BoxedUnit.UNIT;
} else if(var1 instanceof Double) {
.MODULE$.println("Double type");
var2 = BoxedUnit.UNIT;
} else if(var1 instanceof Float) {
.MODULE$.println("Float type");
var2 = BoxedUnit.UNIT;
} else if(var1 instanceof String) {
.MODULE$.println("String type");
var2 = BoxedUnit.UNIT;
} else if(var1 instanceof BigDecimal) {
.MODULE$.println("Big decimal type");
var2 = BoxedUnit.UNIT;
} else {
.MODULE$.println("Unknown type");
var2 = BoxedUnit.UNIT;
}
}
private RunExample$() {
MODULE$ = this;
class.$init$(this);
this.delayedInit(new body(this));
}
}
object RunExample extends App {
val typeTest : Any = "String"
typeTest match {
case i : Int => println("Integer type")
case d : Double => println("Double type")
case f : Float => println("Float type")
case s : String => println("String type")
case _ : BigDecimal => println("Big decimal type")
case _ => println("Unknown type")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment