www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Visual D access violation when using static foreach

reply EntangledQuanta <EQ universe.com> writes:
The following code, when building in Visual D outputs an access 
violation:

alias I(A...) = A;

interface Foo {
         static foreach(T; I!(int, float))
                 void set(T t); // define virt funcs for a list of 
types
}

class Ass : Foo {
         static foreach(T; I!(int, float))
                 void set(T t) {
                         // simplement
                 }
}

void main()
{

}

but when compiling from the command line directly works fine.
Sep 01 2017
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 01.09.2017 21:45, EntangledQuanta wrote:
 The following code, when building in Visual D outputs an access violation:
 
 alias I(A...) = A;
 
 interface Foo {
          static foreach(T; I!(int, float))
                  void set(T t); // define virt funcs for a list
of types
 }
 
 class Ass : Foo {
          static foreach(T; I!(int, float))
                  void set(T t) {
                          // simplement
                  }
 }
 
 void main()
 {
 
 }
 
 but when compiling from the command line directly works fine.
 
It seems "static foreach" doesn't interact well with generating a JSON file with -X. You can disable this in the project configuration page for "Documentation". Please also consider filing a bug report against dmd at https://issues.dlang.org/
Sep 01 2017