Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Dec 14, 2024
1 parent 3ddc108 commit 79d807b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public Description matchLambdaExpression(LambdaExpressionTree tree, VisitorState
|| type.isPrimitive()
|| type.getKind() == TypeKind.TYPEVAR) {
/*
* The method reference syntax does not support casting to parameterized types. Additionally,
* `Class#cast` does not support the same range of type conversions between (boxed) primitive
* types as the cast operator.
* The method reference syntax does not support casting to parameterized types, and type
* variables aren't supported either. Additionally, `Class#cast` does not support the same
* range of type conversions between (boxed) primitive types as the cast operator.
*/
// XXX: Depending on the declared type of the value being cast, in some cases we _can_ rewrite
// primitive casts. Add support for this.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void identification() {
"import java.util.stream.Stream;",
"",
"class A {",
" void m() {",
" <T> void m() {",
" Number localVariable = 0;",
"",
" Stream.of(0).map(i -> i);",
Expand All @@ -36,13 +36,10 @@ void identification() {
" Stream.of(ImmutableSet.of(7)).map(s -> (ImmutableSet<?>) s);",
" Stream.of(8).reduce((a, b) -> (Integer) a);",
" IntStream.of(9).mapToObj(i -> (char) i);",
" Stream.of(10).map(i -> (T) i);",
"",
" // BUG: Diagnostic contains:",
" Stream.of(10).map(i -> (Integer) i);",
" }",
"",
" private <T> void m2() {",
" Stream.of(11).map(i -> (T) i);",
" Stream.of(11).map(i -> (Integer) i);",
" }",
"}")
.doTest();
Expand Down

0 comments on commit 79d807b

Please sign in to comment.