aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-05-17 23:17:58 +0100
committerLouis Pilfold <louis@lpil.uk>2024-05-17 23:17:58 +0100
commitf6be6115d6bbed4b356d9f70a3ac6067db636414 (patch)
tree3109db2071771ad9806940daa11e7fb81f4dc971
parent43e32953ba28a892fe5063d60b253c2c7282cbaf (diff)
downloadgleam_stdlib-f6be6115d6bbed4b356d9f70a3ac6067db636414.tar.gz
gleam_stdlib-f6be6115d6bbed4b356d9f70a3ac6067db636414.zip
Deprecate
-rw-r--r--src/gleam/dynamic.gleam12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index 4fd054a..fda173f 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -35,17 +35,7 @@ pub fn from(a) -> Dynamic {
@external(javascript, "../gleam_stdlib.mjs", "identity")
fn do_from(a: anything) -> Dynamic
-/// Unsafely casts a Dynamic value into any other type.
-///
-/// **If you are using this function then you are almost certainly doing
-/// the wrong thing**.
-///
-/// 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.
-///
+@deprecated("This function undermines the type system and opens the door to cryptic runtime errors and incorrect behaviour")
pub fn unsafe_coerce(a: Dynamic) -> anything {
do_unsafe_coerce(a)
}