File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
end-to-end-tests/src/test/java/net/orfjackal/retrolambda/test Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
- // Copyright © 2013-2015 Esko Luontola <www.orfjackal.net>
1
+ // Copyright © 2013-2016 Esko Luontola <www.orfjackal.net>
2
2
// This software is released under the Apache License 2.0.
3
3
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
4
4
@@ -110,13 +110,23 @@ public void lambdas_with_marker_interfaces_due_to_intersection_types() throws Ex
110
110
}
111
111
112
112
@ Test
113
- public void method_references_to_virtual_methods () throws Exception {
113
+ public void method_references_to_virtual_methods_on_local_variables () throws Exception {
114
114
String foo = "foo" ;
115
115
Callable <String > ref = foo ::toUpperCase ;
116
116
117
117
assertThat (ref .call (), is ("FOO" ));
118
118
}
119
119
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
+
120
130
@ Test
121
131
public void method_references_to_interface_methods () throws Exception {
122
132
List <String > foos = Arrays .asList ("foo" );
You can’t perform that action at this time.
0 commit comments