Hello again. I'm sorry for my late response, there were some trouble with my account and I was not able to login.
Andreas, I modified your code a little so now its manifest same problem. Main difference is that my addListener method is in c++, not AS. Here is code and here is zipped eclipse project as well.
When I launch this code, both addListener calls...
EventSource@ x = cast(console); addListener(x, ET_READLINE); // source is first parameter addListener(cast(console), ET_READLINE); // source is first parameter
... should yield same results. In fact, output is:
ASRefCast: returning 0x940010 addListener: source = 0x940010 addListener: source.value = 2a ASRefCast: returning 0x940010 addListener: source = 0x956400 addListener: source.value = 0
Value passed from typecasting function to addListener gets somehow changed
I'm on ArchLinux (3.6.9-1-ARCH), x86_64, using angelscript 2.25.2, built from AUR. As compiler, g++ (from gcc package, version 4.7.2) is used.