[Issue 15819] array(x) is ok but not x.array, giving contradicting error

2016-03-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15819

--- Comment #2 from Timothee Cour  ---
reduced case:

the issue goes away if we comment "private import std.array;"

module bugs.bug_D20160321T233851;
/+
dmd -unittest -main -run bugs/bug_D20160321T233851.d
+/

import std.traits : isIterable, isNarrowString;
import std.range : isInfinite,isInputRange;
import std.array;

unittest {
  EmitResult temp;
  alias Range = typeof(temp);
  static assert(isInputRange!Range);
  static assert(isIterable!Range && !isNarrowString!Range &&
!isInfinite!Range);
  // BUG:error: cannot resolve type for temp.array(Range)(Range r) if
(isIterable!Range && !isNarrowString!Range && !isInfinite!Range)
  static assert(!is(typeof(temp.array)));
  static assert(is(typeof(array(temp;
}

private struct EmitResult {
  // comment this make things "normal"
  private import std.array;

  @property bool empty() {
return true;
  }

  void popFront() {
  }

  @property int front() {
return 0;
  }

}

--


[Issue 15819] array(x) is ok but not x.array, giving contradicting error

2016-03-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15819

Timothee Cour  changed:

   What|Removed |Added

Summary|Error: cannot resolve type  |array(x) is ok but not
   |for temp.array(Range)(Range |x.array, giving
   |r) if (isIterable!Range &&  |contradicting error
   |!isNarrowString!Range &&|
   |!isInfinite!Range)  |
   |//static|
   |assert(is(typeof(temp.array |
   |)));|

--