mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Fix Function.toString (#1411)
Fixes an issue where the underlying default Java toString() is leaking through
This commit is contained in:
@@ -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 {}"
|
||||
|
||||
Reference in New Issue
Block a user