You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While playing around with the example in #1719 I ended up with a
NegativeArraySizeException when compiling this snippet:
public class X {
public static void main(String[] args) {
String firstName = "Bill", lastName = "Duck";
System.out.println(STR."\{firstName} \{lastName}");
String title = "My Web Page";
String html = STR."""
</head>
""";
System.out.println(html);
}
}
The text was updated successfully, but these errors were encountered:
srikanth-sankaran
changed the title
Internal compiler error: java.lang.NegativeArraySizeException: -3 at Scanner.getCurrentTokenInRange(Scanner.java:525)
[String templates] Internal compiler error: java.lang.NegativeArraySizeException: -3 at Scanner.getCurrentTokenInRange(Scanner.java:525)
Dec 11, 2023
public class X {
public static void main(String[] args) {
String firstName = "Bill", lastName = "Duck";
System.out.println(STR."\{firstName} \{lastName}");
String title = "My Web Page";
String html = STR."""
// <title>\{title}</title>
</head>
""";
System.out.println(html);
}
}
Deleting the line // <title>\{title}</title> causes the crash
public class X {
public static void main(String[] args) {
String firstName = "Bill", lastName = "Duck";
System.out.println(STR."\{firstName} \{lastName}");
String title = "My Web Page";
String html = STR."""
""";
System.out.println(html);
}
}
While playing around with the example in #1719 I ended up with a
NegativeArraySizeException when compiling this snippet:
The text was updated successfully, but these errors were encountered: