www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12917] New: Error: expression lines of type lines does not

https://issues.dlang.org/show_bug.cgi?id=12917

          Issue ID: 12917
           Summary: Error: expression lines of type lines does not have a
                    boolean value
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: timothee.cour2 gmail.com

/+
dmd -version=A1 -c main.d
Error: expression lines of type lines does not have a boolean value
other versions ok

stuff is another module I have
+/


//main.d:
void test(){
  version(A1)
    fun([1]);
  version(A2)
    fun([1]);
  version(A3)
    fun([1]);
}

version(A1)
void fun(size_t[] lines){
    import stuff;
    if(!lines){}
}

version(A2)
void fun(){
  size_t[] lines;
    import stuff;
    if(!lines){}
}

version(A3)
void fun(size_t[] lines_){
    import stuff;
    if(!lines_){}
}

--
Jun 13 2014