digitalmars.D.learn - Cyclic dependency error
- Tony (10/10) Nov 07 2017 My program compiled, but when I ran it I got this error message:
- Steven Schveighoffer (6/19) Nov 07 2017 The asterisks represent modules with module ctors/dtors. So misc is an
- Mike Parker (4/23) Nov 07 2017 See https://dlang.org/spec/module.html#order_of_static_ctor for
My program compiled, but when I ran it I got this error message: object.Error src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* -> variable* I take it that the -> represents a dependency from the module on that line, to the module on the line below. My question is what do the asterisks represent?
Nov 07 2017
On 11/7/17 7:49 AM, Tony wrote:My program compiled, but when I ran it I got this error message: object.Error src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* -> variable* I take it that the -> represents a dependency from the module on that line, to the module on the line below. My question is what do the asterisks represent?The asterisks represent modules with module ctors/dtors. So misc is an intermediate step, but has no module ctor/dtor. A cycle between a module with a ctor and itself is OK, as long as it only goes through such import paths. -Steve
Nov 07 2017
On Tuesday, 7 November 2017 at 14:05:41 UTC, Steven Schveighoffer wrote:On 11/7/17 7:49 AM, Tony wrote:See https://dlang.org/spec/module.html#order_of_static_ctor for options on how to handle cycles other than rewriting.My program compiled, but when I ran it I got this error message: object.Error src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* -> variable* I take it that the -> represents a dependency from the module on that line, to the module on the line below. My question is what do the asterisks represent?The asterisks represent modules with module ctors/dtors. So misc is an intermediate step, but has no module ctor/dtor. A cycle between a module with a ctor and itself is OK, as long as it only goes through such import paths.
Nov 07 2017