Skip to content

Fix #6109: implement FunctionX.curried #6111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,9 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
else {
val arity = field.meth.tpe.widenDealias.paramTypes.size - _1.size
val returnsUnit = field.meth.tpe.widenDealias.resultType.classSymbol == UnitClass
if (returnsUnit)
ctx.requiredClass(("dotty.runtime.function.JProcedure" + arity))
else ctx.requiredClass(("dotty.runtime.function.JFunction" + arity))
if (returnsUnit) ctx.requiredClass(("dotty.runtime.function.JProcedure" + arity))
else if (arity <= 2) ctx.requiredClass(("dotty.runtime.function.JFunction" + arity))
else ctx.requiredClass(("scala.Function" + arity))
}
}
}
Expand Down
233 changes: 0 additions & 233 deletions library/src/dotty/runtime/function/JFunction.java

This file was deleted.

2 changes: 0 additions & 2 deletions library/src/dotty/runtime/function/JFunction0.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

@FunctionalInterface
public interface JFunction0<R> extends scala.Function0<R>, java.io.Serializable {
default void $init$() {
};
default void apply$mcV$sp() {
apply();
}
Expand Down
4 changes: 1 addition & 3 deletions library/src/dotty/runtime/function/JFunction1.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

@FunctionalInterface
public interface JFunction1<T1, R> extends scala.Function1<T1, R>, java.io.Serializable {
default void $init$() {
};

@Override
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -213,7 +211,7 @@ default <A> scala.Function1<A, R> compose(scala.Function1<A, T1> g) {
default scala.Function1 compose$mcDD$sp(scala.Function1 g) {
return compose(g);
}

@SuppressWarnings("unchecked")
default scala.Function1 andThen$mcVI$sp(scala.Function1 g) {
return andThen(g);
Expand Down
24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction10.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction11.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction12.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction13.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction14.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction15.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction16.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction17.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction18.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction19.java

This file was deleted.

26 changes: 2 additions & 24 deletions library/src/dotty/runtime/function/JFunction2.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@

@FunctionalInterface
public interface JFunction2<T1, T2, R> extends scala.Function2<T1, T2, R>, java.io.Serializable {
default void $init$() {
};

@SuppressWarnings("unchecked")
default scala.Function1<T1, scala.Function1<T2, R>> curried() {
return x1 -> x2 -> apply(x1, x2);
}

@SuppressWarnings("unchecked")
default scala.Function1<scala.Tuple2<T1, T2>, R> tupled() {
return x0$1 -> {
if (x0$1 == null) {
throw new MatchError(x0$1);
}
T1 x1 = x0$1._1();
T2 x2 = x0$1._2();
R r = this.apply(x1, x2);
return r;
}
;
}

@SuppressWarnings("unchecked")
default void apply$mcVII$sp(int v1, int v2) {
apply((T1) ((Integer) v1), (T2) ((Integer) v2));
Expand Down Expand Up @@ -247,7 +225,7 @@ default scala.Function1<scala.Tuple2<T1, T2>, R> tupled() {
default double apply$mcDDD$sp(double v1, double v2) {
return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) ((Double) v1), (T2) ((Double) v2)));
}

@SuppressWarnings("unchecked")
default scala.Function1 curried$mcVII$sp() {
return curried();
Expand Down Expand Up @@ -464,7 +442,7 @@ default scala.Function1<scala.Tuple2<T1, T2>, R> tupled() {
default scala.Function1 curried$mcDDD$sp() {
return curried();
}

@SuppressWarnings("unchecked")
default scala.Function1 tupled$mcVII$sp() {
return tupled();
Expand Down
24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction20.java

This file was deleted.

24 changes: 0 additions & 24 deletions library/src/dotty/runtime/function/JFunction21.java

This file was deleted.

Loading