-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lambda): Resolve Literal#constant if required. Fixes #755
- Loading branch information
1 parent
92d7d51
commit 4a89309
Showing
3 changed files
with
103 additions
and
0 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
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,82 @@ | ||
package noclasspath; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class LiteralInForEach { | ||
private static Map<String, UnknownClass> map = new HashMap<>(); | ||
|
||
public static void main(final String[] args) { | ||
booleanLiteral(); | ||
byteLiteral(); | ||
shortLiteral(); | ||
charLiteral(); | ||
intLiteral(); | ||
floatLiteral(); | ||
longLiteral(); | ||
doubleLiteral(); | ||
stringLiteral(); | ||
} | ||
|
||
private static void booleanLiteral() { | ||
map.forEach((key, value) -> { | ||
boolean b0 = true; | ||
boolean b1 = false; | ||
}); | ||
} | ||
|
||
private static void byteLiteral() { | ||
map.forEach((key, value) -> { | ||
byte b = 3; | ||
}); | ||
} | ||
|
||
private static void shortLiteral() { | ||
map.forEach((key, value) -> { | ||
short s = 5; | ||
}); | ||
} | ||
|
||
private static void charLiteral() { | ||
map.forEach((key, value) -> { | ||
char c0 = 'c'; | ||
char c1 = 2; | ||
}); | ||
} | ||
|
||
private static void intLiteral() { | ||
map.forEach((key, value) -> { | ||
int i = 7; | ||
}); | ||
} | ||
|
||
private static void floatLiteral() { | ||
map.forEach((key, value) -> { | ||
float f0 = 9f; | ||
float f1 = 9.0f; | ||
}); | ||
} | ||
|
||
private static void longLiteral() { | ||
map.forEach((key, value) -> { | ||
long l0 = 11L; | ||
long l1 = 11l; | ||
}); | ||
} | ||
|
||
private static void doubleLiteral() { | ||
map.forEach((key, value) -> { | ||
double d0 = 13d; | ||
double d1 = 13D; | ||
double d2 = 13.0d; | ||
double d3 = 13.0D; | ||
double d4 = 13.0; | ||
}); | ||
} | ||
|
||
private static void stringLiteral() { | ||
map.forEach((key, value) -> { | ||
String s = "spoon"; | ||
}); | ||
} | ||
} |