Skip to content

Commit 3942780

Browse files
committed
Java frontend: support lambda method references that imply primitive type widening
For example, an int -> int method is a valid instantiation of a functional interface that expects a byte -> int, or one that expects an int -> long. In both cases it's down to the metafactory / our code that emulates its behaviour to add the widening cast.
1 parent b735954 commit 3942780

18 files changed

+164
-9
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testByteToLong --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testByteToLong:\(\)V.assertion\.1\] line 26 assertion at file Test\.java line 26 function java::Test\.testByteToLong:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testByteToLong:\(\)V.assertion\.2\] line 27 assertion at file Test\.java line 27 function java::Test\.testByteToLong:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testDoubleToFloat --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testDoubleToFloat:\(\)V.assertion\.1\] line 66 assertion at file Test\.java line 66 function java::Test\.testDoubleToFloat:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testDoubleToFloat:\(\)V.assertion\.2\] line 67 assertion at file Test\.java line 67 function java::Test\.testDoubleToFloat:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testFloatToDouble --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testFloatToDouble:\(\)V.assertion\.1\] line 44 assertion at file Test\.java line 44 function java::Test\.testFloatToDouble:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testFloatToDouble:\(\)V.assertion\.2\] line 45 assertion at file Test\.java line 45 function java::Test\.testFloatToDouble:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testIntToLong --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testIntToLong:\(\)V.assertion\.1\] line 38 assertion at file Test\.java line 38 function java::Test\.testIntToLong:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testIntToLong:\(\)V.assertion\.2\] line 39 assertion at file Test\.java line 39 function java::Test\.testIntToLong:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testLongToByte --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testLongToByte:\(\)V.assertion\.1\] line 72 assertion at file Test\.java line 72 function java::Test\.testLongToByte:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testLongToByte:\(\)V.assertion\.2\] line 73 assertion at file Test\.java line 73 function java::Test\.testLongToByte:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testLongToInt --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testLongToInt:\(\)V.assertion\.1\] line 84 assertion at file Test\.java line 84 function java::Test\.testLongToInt:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testLongToInt:\(\)V.assertion\.2\] line 85 assertion at file Test\.java line 85 function java::Test\.testLongToInt:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testLongToShort --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testLongToShort:\(\)V.assertion\.1\] line 78 assertion at file Test\.java line 78 function java::Test\.testLongToShort:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testLongToShort:\(\)V.assertion\.2\] line 79 assertion at file Test\.java line 79 function java::Test\.testLongToShort:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test
3+
--function Test\.testShortToLong --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
\[java::Test\.testShortToLong:\(\)V.assertion\.1\] line 32 assertion at file Test\.java line 32 function java::Test\.testShortToLong:\(\)V bytecode-index 13: SUCCESS
5+
\[java::Test\.testShortToLong:\(\)V.assertion\.2\] line 33 assertion at file Test\.java line 33 function java::Test\.testShortToLong:\(\)V bytecode-index 19: FAILURE
6+
^EXIT=10$
7+
^SIGNAL=0$
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)