Fix Function.toString (#1411)

Fixes an issue where the underlying default Java toString() is leaking
through
This commit is contained in:
Daniel Chao
2026-01-21 07:29:58 -08:00
committed by GitHub
parent 03a7676e64
commit ed0cad668f
7 changed files with 27 additions and 3 deletions
@@ -43,6 +43,10 @@ examples {
"\(new Person2 { name = "Pigeon"; age = 42 })"
"\(null)"
"\(Null(new Person { name = "Pigeon"; age = 42 }))"
"\(() -> null)"
"\((p1) -> null)"
"\((p1, p2) -> null)"
"\((p1, p2, p3) -> null)"
}
["escaping"] {
@@ -9,4 +9,7 @@ res3 = even.apply(11)
local mult = (x, y) -> x * y
res4 = mult.apply(2, 3)
res4 = mult.apply(2, 3)
res5 = even.toString()
res6 = mult.toString()
@@ -34,6 +34,10 @@ examples {
"My name is Pigeon and I'm 42 years old."
"null"
"null"
"new Function0 {}"
"new Function1 {}"
"new Function2 {}"
"new Function3 {}"
}
["escaping"] {
"\\\"\\("
@@ -2,3 +2,5 @@ res1 = "abc"
res2 = true
res3 = false
res4 = 6
res5 = "new Function1 {}"
res6 = "new Function2 {}"