Skip to content

Commit 365b819

Browse files
committed
Test for a bug with pull request #83
1 parent 20f959c commit 365b819

File tree

1 file changed

+12
-2
lines changed
  • end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test

1 file changed

+12
-2
lines changed

end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test/LambdaTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2013-2015 Esko Luontola <www.orfjackal.net>
1+
// Copyright © 2013-2016 Esko Luontola <www.orfjackal.net>
22
// This software is released under the Apache License 2.0.
33
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
44

@@ -110,13 +110,23 @@ public void lambdas_with_marker_interfaces_due_to_intersection_types() throws Ex
110110
}
111111

112112
@Test
113-
public void method_references_to_virtual_methods() throws Exception {
113+
public void method_references_to_virtual_methods_on_local_variables() throws Exception {
114114
String foo = "foo";
115115
Callable<String> ref = foo::toUpperCase;
116116

117117
assertThat(ref.call(), is("FOO"));
118118
}
119119

120+
@Test
121+
public void method_references_to_virtual_methods_on_instance_variables() throws Exception {
122+
Callable<String> ref = instanceVarFoo::toUpperCase;
123+
124+
assertThat(ref.call(), is("FOO"));
125+
}
126+
127+
@SuppressWarnings("FieldCanBeLocal")
128+
private String instanceVarFoo = "foo";
129+
120130
@Test
121131
public void method_references_to_interface_methods() throws Exception {
122132
List<String> foos = Arrays.asList("foo");

0 commit comments

Comments
 (0)