Last active
December 1, 2015 21:10
-
-
Save romac/7a904c41fba196780aad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| * Decompiled with CFR 0_108. | |
| * | |
| * Could not load the following classes: | |
| * const$$anonfun | |
| * const$$anonfun$lamConst | |
| * scala.Function1 | |
| * scala.runtime.AbstractFunction1 | |
| */ | |
| import scala.Function1; | |
| import scala.runtime.AbstractFunction1; | |
| public final class const$ { | |
| public static final const$ MODULE$; | |
| public static { | |
| new const$(); | |
| } | |
| public <A, B> A defConst(A x, B y) { | |
| return x; | |
| } | |
| public <A, B> Function1<B, A> lamConst(A x) { | |
| return new scala.Serializable(x){ | |
| public static final long serialVersionUID = 0; | |
| private final Object x$1; | |
| public final A apply(B y) { | |
| return (A)this.x$1; | |
| } | |
| }; | |
| } | |
| public void test() { | |
| AbstractFunction1<Object, String> defRetFoo = new scala.Serializable(){ | |
| public static final long serialVersionUID = 0; | |
| public final String apply(Object y) { | |
| return const$.MODULE$.defConst("foo", y); | |
| } | |
| }; | |
| String defFoo = (String)defRetFoo.apply((Object)"bar"); | |
| Function1<B, String> lamRetFoo = this.lamConst("foo"); | |
| String lamFoo = (String)lamRetFoo.apply((Object)"bar"); | |
| } | |
| private const$() { | |
| MODULE$ = this; | |
| } | |
| } |
This file contains hidden or 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
| object const { | |
| @inline | |
| def defConst[A, B](x: A)(y: B): A = x | |
| @inline | |
| def lamConst[A, B](x: A): B => A = y => x | |
| def test = { | |
| val defRetFoo = defConst("foo") _ | |
| val defFoo = defRetFoo("bar") | |
| val lamRetFoo = lamConst("foo") | |
| val lamFoo = lamRetFoo("bar") | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment