aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-05-09 12:57:53 +0100
committerLouis Pilfold <louis@lpil.uk>2024-05-09 12:57:53 +0100
commit7d65d9377267e9c0ff9af5de64b25bce6a1801a2 (patch)
treeb50892c8c294d49136cd89d2ba5b3dd7aa96755c
parentb92e284631cacf0711545445e87241e8d512ed8f (diff)
downloadgleam_stdlib-7d65d9377267e9c0ff9af5de64b25bce6a1801a2.tar.gz
gleam_stdlib-7d65d9377267e9c0ff9af5de64b25bce6a1801a2.zip
Make dynamic warning stronger
-rw-r--r--src/gleam/dynamic.gleam10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index e796de0..4fd054a 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -37,10 +37,14 @@ fn do_from(a: anything) -> Dynamic
/// Unsafely casts a Dynamic value into any other type.
///
-/// This is an escape hatch for the type system that may be useful when wrapping
-/// native Erlang APIs. It is to be used as a last measure only!
+/// **If you are using this function then you are almost certainly doing
+/// the wrong thing**.
///
-/// If you can avoid using this function, do!
+/// This is an escape hatch for the type system that may be useful when wrapping
+/// native Erlang APIs. You should always avoid using this function as it
+/// undermines the type system and removes all the guarentees that Gleam offers
+/// you. You are on your own to avoid cryptic runtime bugs and crashes if you
+/// use this.
///
pub fn unsafe_coerce(a: Dynamic) -> anything {
do_unsafe_coerce(a)