-
-
Save xuwei-k/7182174 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[syntax trees at end of jvm]] // Param.scala | |
package <empty> { | |
final class Param extends Object { | |
<paramaccessor> private[this] val i: Int = _; | |
<stable> <accessor> <paramaccessor> def i(): Int = Param.this.i; | |
override <synthetic> def hashCode(): Int = Param.hashCode$extension(Param.this.i()); | |
override <synthetic> def equals(x$1: Object): Boolean = Param.equals$extension(Param.this.i(), x$1); | |
def <init>(i: Int): Param = { | |
Param.this.i = i; | |
Param.super.<init>(); | |
() | |
} | |
}; | |
object Param extends Object { | |
final private[this] val ConstantA: Int = _; | |
final <stable> <accessor> def ConstantA(): Int = Param.this.ConstantA; | |
final private[this] val ConstantB: Int = _; | |
final <stable> <accessor> def ConstantB(): Int = Param.this.ConstantB; | |
final <synthetic> def hashCode$extension($this: Int): Int = scala.Int.box($this).hashCode(); | |
final <synthetic> def equals$extension($this: Int, x$1: Object): Boolean = { | |
case <synthetic> val x1: Object = x$1; | |
case5(){ | |
if (x1.$isInstanceOf[Param]()) | |
matchEnd4(true) | |
else | |
case6() | |
}; | |
case6(){ | |
matchEnd4(false) | |
}; | |
matchEnd4(x: Boolean){ | |
x | |
} | |
}.&&({ | |
<synthetic> val Param$1: Int = x$1.$asInstanceOf[Param]().i(); | |
$this.==(Param$1) | |
}); | |
def <init>(): Param.type = { | |
Param.super.<init>(); | |
Param.this.ConstantA = -1; | |
Param.this.ConstantB = 0; | |
() | |
} | |
}; | |
object Main extends Object { | |
def foo(i: Int): Int = i; | |
def <init>(): Main.type = { | |
Main.super.<init>(); | |
Main.this.foo(Param.ConstantA()); | |
() | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Param(val i: Int) extends AnyVal | |
object Param{ | |
final val ConstantA = new Param(-1) | |
final val ConstantB = new Param(0) | |
} | |
object Main{ | |
def foo(i: Param) = i | |
foo(Param.ConstantA) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment