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
Constructor aliasing fails #2
Comments
I found a hilariously old thread about this: http://forum.dlang.org/thread/fv7r3g$3ub$1@digitalmars.com Seems the problem is this: http://dlang.org/struct.html#StructLiteral
...
Which you seem to do. Huh, weird. Anyway, changing the test.d to not use struct literals makes at least btVector3 work.
quaternion.d's mixin(joinOverloads!.. doesn't actually mixin anything? |
I had replaced all of the constructors with static opCall because I was At this point, I think that D might not be ready to create a binding On 09/23/13 05:24, vuaru wrote:
|
Oh so you do have only opCalls defined, and no constructors. Then it makes sense that they cannot be used as struct literals in test.d, since that's what the link explicitly states. It's a limitation, sure, but if that's the only problem left.. |
On 09/23/13 12:35, vuaru wrote:
|
What were these issues specifically? |
On 09/24/13 08:03, vuaru wrote:
struct SomeBindingClass {
} The constructors have to be aliased together for overloading to work on |
If I understand correctly, then you're saying you can't use the template mixins to insert multiple overloading contructors? Either that is no longer the case or I'm misunderstanding, because I just tried the following simplified example which compiles:
(Note: I'm interested in making a simplified version of the wished-for functionality so I can ask the newsgroups for help.) |
It works when all of the overloaded constructors are in the same |import std.stdio; void main() struct Tree
} mixin template constructor(Args) That example is much closer to the actual structure of the binding code. On 09/24/13 11:56, vuaru wrote:
|
It does compile, assuming you meant
(Where does one find documentation about these kind of language features anyway?) |
With the current DMD release, the code just chokes with an assertion error. Have you tested it with a development build? |
You're right it does (in fact it gives an abnormal program termination) with DMD 2.063.2. But it does compile with a fairly recent git HEAD (which I was using because that was required for bulletD anyway). So to me it seems that the problem has been solved in DMD, just not yet released officially. |
Interesting... |
Mixing in multiple constructors and aliasing them together makes DMD complain that the constructors are not accessible.
The text was updated successfully, but these errors were encountered: