> It's a type hint, it's not a type coercion.
>
> Without the type hint, the compiler doesn't know the type of s, so it
> can't find the .getBytes method (nor, of course, its return type) and,
> in doubt, picks the "broader" constructor: OtpErlangBinary(Object).
> With the type hint, the compiler know that s must be treated as a
> String, it find .getBytes, sees that it returns a byte[] and is able to
> select the right constructor for OtpErlangBinary.

Is the OtpErlangBinary constructor that's being used actually
determined at compile time, rather than at run time?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to