Re: Arrays of an interface

2013-12-31 Thread bearophile
Abdulhaq: Ah! Great, doing the full import fixed it. The interface precedes the implementation in the same file, so it seems to me it's possibly a subtle glitch in the compiler with selective imports (the change I was making was in another module where I was subclassing Klass, which was the c

Re: Arrays of an interface

2013-12-31 Thread Abdulhaq
On Tuesday, 31 December 2013 at 14:54:31 UTC, Adam D. Ruppe wrote: On Tuesday, 31 December 2013 at 14:43:25 UTC, Abdulhaq wrote: Well, interfaces don't have sizes, do they? They have fixed size, interfaces are always implemented as pointers. Could be a forward reference problem, make sure y

Re: Arrays of an interface

2013-12-31 Thread Adam D. Ruppe
On Tuesday, 31 December 2013 at 14:43:25 UTC, Abdulhaq wrote: Well, interfaces don't have sizes, do they? They have fixed size, interfaces are always implemented as pointers. Could be a forward reference problem, make sure you import the module with the interface above any use of it, and do

Re: Arrays of an interface

2013-12-31 Thread Abdulhaq
Sorry to reply to me own post so quickly, a clue (it seems to me) is this part of the error: smidgen/ast/klass.d(15): Error: size of type Method is not known Line 15 is where I import the interface: import smidgen.ast.method: Method, MethodImpl, Visibility, SMID; and in the relevant file, int

Re: Arrays of an interface

2013-12-31 Thread Adam D. Ruppe
Can you post more of the code? Maybe MethodImpl forgot to inherit from Method or there's a const mismatch or something like that.

Re: Arrays of an interface

2013-12-31 Thread Abdulhaq
On Tuesday, 31 December 2013 at 14:41:39 UTC, Adam D. Ruppe wrote: Can you post more of the code? Maybe MethodImpl forgot to inherit from Method or there's a const mismatch or something like that. Here you are: /** * The MethodImpl class is the main implementation of Method */ class MethodImp

Re: Arrays of an interface

2013-12-31 Thread Abdulhaq
On Tuesday, 31 December 2013 at 14:26:33 UTC, bearophile wrote: Abdulhaq: I have a feeling that D doesn't fully support arrays of interfaces, e.g. Method[], particularly as a return type. If that's true, than it seems a D bug worth fixing. Are you able and willing to create a minimized examp

Re: Arrays of an interface

2013-12-31 Thread bearophile
Abdulhaq: I have a feeling that D doesn't fully support arrays of interfaces, e.g. Method[], particularly as a return type. If that's true, than it seems a D bug worth fixing. Are you able and willing to create a minimized example (later useful for Bugzilla)? Bye, bearophile

Arrays of an interface

2013-12-31 Thread Abdulhaq
Hi all, hoping someone can help, I'm used to coding to interfaces and I'm using them very lightly in an application I'm writing (a CPP wrapper like SWIG, except in D). Every now and then I touch a piece of code which seems almost unrelated and then get a bunch of compile errors such as the fo