Thread overview | |||||
---|---|---|---|---|---|
|
July 25, 2007 [Issue 1371] New: Compiler rejects valid delegate. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1371 Summary: Compiler rejects valid delegate. Product: D Version: 1.019 Platform: PC OS/Version: Linux Status: NEW Keywords: rejects-valid Severity: normal Priority: P3 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: aziz.kerim@gmail.com // The compiler tries to parse this as a struct initializer. auto foo = { while (doSomething()){} }; // Error: expression expected, not 'while' There are several workarounds to this. auto foo = { while (doSomething()){;} }; // Insert a semicolon somewhere. auto foo = (){ while (doSomething()){} }; // Add a ParameterList. auto foo = delegate void (){ while (doSomething()){} }; // A full delegate expression. -- |
August 14, 2007 [Issue 1371] Compiler rejects valid delegate. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1371 Daniel919@web.de changed: What |Removed |Added ---------------------------------------------------------------------------- Version|1.019 |2.003 ------- Comment #1 from Daniel919@web.de 2007-08-14 18:45 ------- string delegate() dg = { return "dg"; }; //Error: functions cannot return static array invariant char[2u] //Error: cannot implicitly convert expression (__dgliteral1) of type int delegate() to const(char)[] delegate() string delegate() dg = { return cast(string) "dg"; }; //OK //string delegate() dg = delegate string() { return "dg"; }; //OK //auto dg = { return "dg".dup; }; //OK -- |
June 18, 2011 [Issue 1371] Compiler rejects valid delegate. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1371 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |k.hara.pg@gmail.com --- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-06-18 01:21:09 PDT --- Follwing still fails in trunk dmd 2.054 (d36b3b12fc4814e59f3a0d680b8700e787b1ceff). auto foo = { while (doSomething()){} }; Workarounds are as same. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation