www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - writeln(Range) fails on 2.058

reply simendsjo <simendsjo gmail.com> writes:
import std.array;
import std.stdio;

struct S
{
     string txt;

     void popFront()
     {
         txt.popFront();
     }

      property dchar front()
     {
         return txt.front;
     }

      property bool empty()
     {
         return txt.empty;
     }
}

void main() {
     S s;
     writeln(s); // range.d(295): Error: static assert  "Cannot put a S 
into a LockingTextWriter"
}

I haven't read the whole changelog yet, so this might not be a bug. 
Pretty convenient when it worked though..
Feb 15 2012
parent reply simendsjo <simendsjo gmail.com> writes:
On 02/15/2012 09:33 AM, simendsjo wrote:
 import std.array;
 import std.stdio;

 struct S
 {
 string txt;

 void popFront()
 {
 txt.popFront();
 }

  property dchar front()
 {
 return txt.front;
 }

  property bool empty()
 {
 return txt.empty;
 }
 }

 void main() {
 S s;
 writeln(s); // range.d(295): Error: static assert "Cannot put a S into a
 LockingTextWriter"
 }

 I haven't read the whole changelog yet, so this might not be a bug.
 Pretty convenient when it worked though..
Seems the issue is triggered by using *char front(). Other types still work. import std.stdio; struct S { void popFront() { } property char front() { return 'a'; } property bool empty() { return false; } } void main() { writeln(S()); // range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" }
Feb 15 2012
parent reply simendsjo <simendsjo gmail.com> writes:
On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo <simendsjo gmail.com> wrote:

 On 02/15/2012 09:33 AM, simendsjo wrote:
 import std.array;
 import std.stdio;

 struct S
 {
 string txt;

 void popFront()
 {
 txt.popFront();
 }

  property dchar front()
 {
 return txt.front;
 }

  property bool empty()
 {
 return txt.empty;
 }
 }

 void main() {
 S s;
 writeln(s); // range.d(295): Error: static assert "Cannot put a S into a
 LockingTextWriter"
 }

 I haven't read the whole changelog yet, so this might not be a bug.
 Pretty convenient when it worked though..
Seems the issue is triggered by using *char front(). Other types still work. import std.stdio; struct S { void popFront() { } property char front() { return 'a'; } property bool empty() { return false; } } void main() { writeln(S()); // range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" }
Ping? range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" format.d(1509): instantiated from here: put!(LockingTextWriter,S) format.d(1984): instantiated from here: formatRange!(LockingTextWriter,S,char) format.d(2228): instantiated from here: formatValue!(LockingTextWriter,S,char) format.d(319): instantiated from here: formatGeneric!(LockingTextWriter,S,char) stdio.d(684): instantiated from here: formattedWrite!(LockingTextWriter,char,S) stdio.d(1563): instantiated from here: write!(S,char)
Feb 17 2012
parent reply simendsjo <simendsjo gmail.com> writes:
On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo <simendsjo gmail.com> wrote:

 On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo <simendsjo gmail.com>  
 wrote:

 On 02/15/2012 09:33 AM, simendsjo wrote:
 import std.array;
 import std.stdio;

 struct S
 {
 string txt;

 void popFront()
 {
 txt.popFront();
 }

  property dchar front()
 {
 return txt.front;
 }

  property bool empty()
 {
 return txt.empty;
 }
 }

 void main() {
 S s;
 writeln(s); // range.d(295): Error: static assert "Cannot put a S into  
 a
 LockingTextWriter"
 }

 I haven't read the whole changelog yet, so this might not be a bug.
 Pretty convenient when it worked though..
Seems the issue is triggered by using *char front(). Other types still work. import std.stdio; struct S { void popFront() { } property char front() { return 'a'; } property bool empty() { return false; } } void main() { writeln(S()); // range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" }
Ping? range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" format.d(1509): instantiated from here: put!(LockingTextWriter,S) format.d(1984): instantiated from here: formatRange!(LockingTextWriter,S,char) format.d(2228): instantiated from here: formatValue!(LockingTextWriter,S,char) format.d(319): instantiated from here: formatGeneric!(LockingTextWriter,S,char) stdio.d(684): instantiated from here: formattedWrite!(LockingTextWriter,char,S) stdio.d(1563): instantiated from here: write!(S,char)
Ok, the changelog doesn't state any changes to formating, but other stuff has changed too. actual union values as in 2.057. Should I report these as regressions as the changelog doesn't mention them?
Feb 17 2012
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 02/17/2012 12:58 PM, simendsjo wrote:
 On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo <simendsjo gmail.com> wrote:

 On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo <simendsjo gmail.com>
 wrote:

 On 02/15/2012 09:33 AM, simendsjo wrote:
 import std.array;
 import std.stdio;

 struct S
 {
 string txt;

 void popFront()
 {
 txt.popFront();
 }

  property dchar front()
 {
 return txt.front;
 }

  property bool empty()
 {
 return txt.empty;
 }
 }

 void main() {
 S s;
 writeln(s); // range.d(295): Error: static assert "Cannot put a S
 into a
 LockingTextWriter"
 }

 I haven't read the whole changelog yet, so this might not be a bug.
 Pretty convenient when it worked though..
Seems the issue is triggered by using *char front(). Other types still work. import std.stdio; struct S { void popFront() { } property char front() { return 'a'; } property bool empty() { return false; } } void main() { writeln(S()); // range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" }
Ping? range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" format.d(1509): instantiated from here: put!(LockingTextWriter,S) format.d(1984): instantiated from here: formatRange!(LockingTextWriter,S,char) format.d(2228): instantiated from here: formatValue!(LockingTextWriter,S,char) format.d(319): instantiated from here: formatGeneric!(LockingTextWriter,S,char) stdio.d(684): instantiated from here: formattedWrite!(LockingTextWriter,char,S) stdio.d(1563): instantiated from here: write!(S,char)
Ok, the changelog doesn't state any changes to formating, but other stuff has changed too. actual union values as in 2.057. Should I report these as regressions as the changelog doesn't mention them?
here>} is part of a (possibly unlisted?) bugfix by Kenji Hara.
Feb 17 2012
parent simendsjo <simendsjo gmail.com> writes:
On Fri, 17 Feb 2012 14:44:15 +0100, Timon Gehr <timon.gehr gmx.ch> wrote:

 On 02/17/2012 12:58 PM, simendsjo wrote:
 On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo <simendsjo gmail.com>  
 wrote:

 On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo <simendsjo gmail.com>
 wrote:

 On 02/15/2012 09:33 AM, simendsjo wrote:
 import std.array;
 import std.stdio;

 struct S
 {
 string txt;

 void popFront()
 {
 txt.popFront();
 }

  property dchar front()
 {
 return txt.front;
 }

  property bool empty()
 {
 return txt.empty;
 }
 }

 void main() {
 S s;
 writeln(s); // range.d(295): Error: static assert "Cannot put a S
 into a
 LockingTextWriter"
 }

 I haven't read the whole changelog yet, so this might not be a bug.
 Pretty convenient when it worked though..
Seems the issue is triggered by using *char front(). Other types still work. import std.stdio; struct S { void popFront() { } property char front() { return 'a'; } property bool empty() { return false; } } void main() { writeln(S()); // range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" }
Ping? range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" format.d(1509): instantiated from here: put!(LockingTextWriter,S) format.d(1984): instantiated from here: formatRange!(LockingTextWriter,S,char) format.d(2228): instantiated from here: formatValue!(LockingTextWriter,S,char) format.d(319): instantiated from here: formatGeneric!(LockingTextWriter,S,char) stdio.d(684): instantiated from here: formattedWrite!(LockingTextWriter,char,S) stdio.d(1563): instantiated from here: write!(S,char)
Ok, the changelog doesn't state any changes to formating, but other stuff has changed too. actual union values as in 2.057. Should I report these as regressions as the changelog doesn't mention them?
here>} is part of a (possibly unlisted?) bugfix by Kenji Hara.
But I liked that it spit out my union... :| http://d.puremagic.com/issues/show_bug.cgi?id=7531
Feb 17 2012