-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getContainingMethod returns null for lambdas; fixes issue #3850
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import org.checkerframework.checker.nullness.qual.PolyNull; | ||
|
||
class Issue3850 { | ||
|
||
private static Iterable<@PolyNull String> toPos(Iterable<? extends @PolyNull Object> nodes) { | ||
// :: error: (return.type.incompatible) | ||
return transform(nodes, node -> node == null ? null : node.toString()); | ||
} | ||
|
||
public static <F, T> Iterable<T> transform( | ||
Iterable<? extends F> iterable, | ||
java.util.function.Function<? super F, ? extends T> function) { | ||
throw new Error("implementation is irrelevant"); | ||
} | ||
} |