Skip to content

Commit

Permalink
Test for a bug with pull request #83
Browse files Browse the repository at this point in the history
  • Loading branch information
luontola committed Jan 10, 2016
1 parent 20f959c commit 365b819
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2013-2015 Esko Luontola <www.orfjackal.net>
// Copyright © 2013-2016 Esko Luontola <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0

Expand Down Expand Up @@ -110,13 +110,23 @@ public void lambdas_with_marker_interfaces_due_to_intersection_types() throws Ex
}

@Test
public void method_references_to_virtual_methods() throws Exception {
public void method_references_to_virtual_methods_on_local_variables() throws Exception {
String foo = "foo";
Callable<String> ref = foo::toUpperCase;

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

@Test
public void method_references_to_virtual_methods_on_instance_variables() throws Exception {
Callable<String> ref = instanceVarFoo::toUpperCase;

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

@SuppressWarnings("FieldCanBeLocal")
private String instanceVarFoo = "foo";

@Test
public void method_references_to_interface_methods() throws Exception {
List<String> foos = Arrays.asList("foo");
Expand Down

0 comments on commit 365b819

Please sign in to comment.