Skip to content

Commit

Permalink
Fix crash with switch expression as a lambda body (#543)
Browse files Browse the repository at this point in the history
Fixes #524 

Fixed by bumping Checker Framework version
  • Loading branch information
msridhar authored Jan 9, 2022
1 parent bde8d50 commit ae3629d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (project.hasProperty("epApiVersion")) {
}
def versions = [
asm : "7.1",
checkerFramework : "3.21.0",
checkerFramework : "3.21.1",
// The version of Error Prone used to check NullAway's code
errorProne : "2.10.0",
// The version of Error Prone that NullAway is compiled and tested against
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,20 @@ public void testSwitchExprUnbox() {
"}")
.doTest();
}

@Test
public void testSwitchExprLambda() {
defaultCompilationHelper
.addSourceLines(
"SwitchExpr.java",
"package com.uber;",
"import java.util.function.Function;",
"class SwitchExpr {",
" int i;",
" public void testSwitchExprLambda() {",
" Function<SwitchExpr,Object> f = (s) -> switch (s.i) { case 3, 4, 5 -> new Object(); default -> \"hello\"; };",
" }",
"}")
.doTest();
}
}

0 comments on commit ae3629d

Please sign in to comment.