Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface downcast doesn't get upcast when calling through #729

Closed
etcimon opened this issue Sep 30, 2014 · 2 comments
Closed

Interface downcast doesn't get upcast when calling through #729

etcimon opened this issue Sep 30, 2014 · 2 comments

Comments

@etcimon
Copy link
Contributor

etcimon commented Sep 30, 2014

I've been trying to isolate this for a couple days but can't get through with it. It's an issue with interface (dynamic) casting, but every test I make with in isolated applications runs just fine.

Anyways, trying my luck here with this complicated problem, maybe someone knows something can be improved somewhere.. It happens in my native implementation of vibe.d :

https://github.com/etcimon/vibe.d/blob/native-events/source/vibe/http/server.d#L1220

Notice I've upcast manually the TCPConnection line 1214 because otherwise the LibasyncTCPConnection (twice) derived instance has a this instance as a copy of the .vtbl() reference pointer when calling the overriden methods. It makes it impossible to modify the state of the object at any time and it's (I think) the only obstacle preventing it from being compiled completely with LDC. This also causes errors with invariant, so I had to disable core.rt.invariant and compile without it to diagnose the issue.

I can't really do much more with this workaround because I'd have to upcast in every delegate, and TCPConnection is used everywhere. I've been using the latest LDC compiled with GCC 4.8 and using LLVM 3.4

Also, I'm using GC.malloc.

Any ideas?

@kinke
Copy link
Member

kinke commented Aug 21, 2016

@etcimon: Still an issue or safe to be closed?

@kinke
Copy link
Member

kinke commented Oct 30, 2017

Closing due to lack of information/reproducibility.

@kinke kinke closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants