aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/text/encoding.lux6
1 files changed, 5 insertions, 1 deletions
diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux
index 1ce536436..e1066bbcd 100644
--- a/stdlib/source/lux/data/text/encoding.lux
+++ b/stdlib/source/lux/data/text/encoding.lux
@@ -184,7 +184,11 @@
(def: #export (to-utf8 value)
(-> Text Binary)
(`` (for {(~~ (static @.old))
- (java/lang/String::getBytes (..name ..utf-8) value)
+ (java/lang/String::getBytes (..name ..utf-8)
+ ## The coercion below may seem
+ ## gratuitous, but removing it
+ ## causes a grave compilation problem.
+ (:coerce java/lang/String value))
(~~ (static @.jvm))
(java/lang/String::getBytes (..name ..utf-8) value)})))