What's happening behind the scene with implicitly unwrapped option when it's being evaluated?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What's happening behind the scene with implicitly unwrapped option when it's being evaluated?

Boon Chew

What's happening behind the scene with implicitly unwrapped option?
Does the compile perform the unboxing of ImplicitlyUnwrappedOptional behind the scene, right before you use the value in an expression?  Since ImplicitlyUnwrappedOptional is a struct, can the same operation be done in Swift?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/7ef04ad1-d9be-4918-997b-d98c711a90fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: What's happening behind the scene with implicitly unwrapped option when it's being evaluated?

Brent Royal-Gordon-2
Implicitly unwrapped optionals are treated specially by the compiler; there's no way for us to write something similar.

(For that matter, regular optionals have some special behavior too; the automatic conversion of Foo to Optional<Foo> is unique to optionals. But they're far less magical than implicitly unwrapped optionals.)
On Wed, Jun 17, 2015 at 8:51 AM Boon <[hidden email]> wrote:

What's happening behind the scene with implicitly unwrapped option?
Does the compile perform the unboxing of ImplicitlyUnwrappedOptional behind the scene, right before you use the value in an expression?  Since ImplicitlyUnwrappedOptional is a struct, can the same operation be done in Swift?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/7ef04ad1-d9be-4918-997b-d98c711a90fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/CAEeRk-Y6cxcomFKB0%2BU4xhpcjphDRMsdoysCE8FkQe1oy053Qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.