On Sunday, 17 March 2024 at 20:38:16 UTC, Per Nordlöw wrote:
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. Shouldn't it?
Ahh, nevermind. I defined these inside a unittest scope so that's
why it failed. Defining
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. Shouldn't it?
as well? There
> > is no way to determine which constructor to run first, so the runtime
> > throws a "cyclic dependency" exception.
>
>
> I should mention that this can happen with larger cycles as well, i.e. "a
> imports b, b imports c, c imports ..., ..
t; throws a "cyclic dependency" exception.
I should mention that this can happen with larger cycles as well, i.e.
"a
imports b, b imports c, c imports ..., ... imports a". This can make
some cyclic dependencies very hard to track down.
There was a discussion about this on
Jonathan M Davis:
> Well, just knowing that it involves module constructors is definitely useful,
> though the error message really needs to be improved. Thanks.
You may file a bug report, with an example, asking for a better error message
(with a better wording), or a much better error message
ay to determine which constructor to run first, so the runtime
> > throws a "cyclic dependency" exception.
>
> I should mention that this can happen with larger cycles as well, i.e. "a
> imports b, b imports c, c imports ..., ... imports a". This can make
> some cyc
before a's,
> since a depends on b. But what happens if b imports a as well? There
> is no way to determine which constructor to run first, so the runtime
> throws a "cyclic dependency" exception.
I should mention that this can happen with larger cycles as well, i.e. "a
On Wed, 13 Oct 2010 21:25:15 -0700, Jonathan M Davis wrote:
> Okay. in the code that I'm working on at the moment, I get an exception
> saying that a cyclic dependency was detected but no information
> whatsoever as to where it is or what it means. I haven't been able to
> find much information on
Okay. in the code that I'm working on at the moment, I get an exception saying
that a cyclic dependency was detected but no information whatsoever as to where
it is or what it means. I haven't been able to find much information on them
other than some discussions of making it so that the compile
Ellery Newcomer wrote:
Hello all,
I began learning D a few months ago, and now I have a question about
cyclic dependencies (and some random whining).
I come from a java background and have had no serious exposure to C++.
In java, cyclic dependencies are legit to the best of my knowledge. I
"Jarrett Billingsley" wrote
> It can obviously be argued that since the operands of ?: are constant,
> the compiler _could_ figure out that they should be of type wchar[],
> but that would make the semantic analysis more complicated, and since
> appending 'w' to the strings is far easier, it probab
Jarrett Billingsley wrote:
On Tue, Dec 9, 2008 at 12:00 PM, Ellery Newcomer
<[EMAIL PROTECTED]> wrote:
Derek Parnell wrote:
> It is not a bug. A string literal such as "true" is a char[] type (UTF8),
and the compiler will not implicitly convert UTF8 to UTF16 (wchar[]).
Which would then beg th
On Tue, Dec 9, 2008 at 12:00 PM, Ellery Newcomer
<[EMAIL PROTECTED]> wrote:
> Derek Parnell wrote:
> > It is not a bug. A string literal such as "true" is a char[] type (UTF8),
>>
>> and the compiler will not implicitly convert UTF8 to UTF16 (wchar[]).
>
> Which would then beg the obvious
>
> wcha
Lars Ivar Igesund wrote:
Tango 0.99.7 doesn't support DMD 1.037 - either use DMD 1.033 or check out
Tango trunk.
Say what you will, I got it to work :)
I also experienced the crash on 1.030, 1.033, and 1.035 variously on
linux and windows, so 1.037 was just to see if it had been fixed by
Derek Parnell wrote:
> It is not a bug. A string literal such as "true" is a char[] type
(UTF8),
and the compiler will not implicitly convert UTF8 to UTF16 (wchar[]).
Which would then beg the obvious
wchar[] w = "true";
torhu wrote:
You can't use module constructors (static this) in modules that import
each other.
So THAT'S why I couldn't replicate it :)
On Tue, Dec 9, 2008 at 9:52 AM, Steven Schveighoffer
<[EMAIL PROTECTED]> wrote:
> I'm not sure about this problem. I've not encountered it, but it sounds
> weird that it would cause a runtime error...
It is weird.
[a.d]
module a;
import b;
static this(){}
void main(){}
[b.d]
mod
"Ellery Newcomer" wrote
> Hello all,
>
> I began learning D a few months ago, and now I have a question about
> cyclic dependencies (and some random whining).
>
> I come from a java background and have had no serious exposure to C++. In
> java, cyclic dependenc
On Tue, 09 Dec 2008 10:26:29 +0300, Ellery Newcomer <[EMAIL PROTECTED]> wrote:
Also, I would be trying to compile with DMD, but I have evidently
managed to crash the compiler, and I don't know if it's DMD's fault or
mine. It reports an Internal Error in e2ir.c at line 3904. (not being a
C++
Ellery Newcomer wrote:
> Hello all,
>
> I began learning D a few months ago, and now I have a question about
> cyclic dependencies (and some random whining).
>
> I come from a java background and have had no serious exposure to C++.
> In java, cyclic dependencies are le
Ellery Newcomer wrote:
When I first started learning D I decided that a good way to learn it
would be by porting a popular java api (mind, I didn't say intelligent),
which came complete with a few cyclic dependencies. At the moment, I'm
using GDC, and it refuses to swallow cyclic de
On Tue, 09 Dec 2008 01:26:29 -0600, Ellery Newcomer wrote:
>
> wchar[] w = (true)? "true":"false";
>
> --> Error: cannot implicitly convert expression ("true") of type char[]
> to wchar[]
>
> or should it be reported as a bug?
It is not a bug. A string literal such as "true" is a char[] type
Ellery Newcomer Wrote:
> Hello all,
>
> I began learning D a few months ago, and now I have a question about
> cyclic dependencies (and some random whining).
>
> I come from a java background and have had no serious exposure to C++.
> In java, cyclic dependencies are le
Hello all,
I began learning D a few months ago, and now I have a question about
cyclic dependencies (and some random whining).
I come from a java background and have had no serious exposure to C++.
In java, cyclic dependencies are legit to the best of my knowledge. I
don't know ab
24 matches
Mail list logo