On Friday, 31 July 2015 at 07:35:47 UTC, Marek Janukowicz wrote:
So patten matching only works on type of containing variable, not the type of the object itself. Is it possible to work around this?

No, it would be very surprising if receive performed a dynamic downcast, and it's also somewhat expensive.
If you want that, do the downcast in your handler yourself.

Won't the object get possibly GC'ed when it runs out of scope in origin thread while handler thread still uses it?

No, the GC pauses and scans all threads for roots.


Reply via email to