Re: Function literal bug?

2013-11-28 Thread Sergei Nosov
On Thursday, 28 November 2013 at 10:23:39 UTC, Kenji Hara wrote: It's a known front-end issue. https://d.puremagic.com/issues/show_bug.cgi?id=11545 Kenji Hara Great! Does this pull resolve both issues? (correct length and x=>x syntax)

Re: Function literal bug?

2013-11-28 Thread Kenji Hara
On Thursday, 28 November 2013 at 09:48:47 UTC, bearophile wrote: Sergei Nosov: Do you have a 64-bit OS at hand? On 64 bit using dmd 2.064.2 it doesn't give the 6 6 output, so it seems a 64 bit bug. This happens because the 64 bit version of dmd is quite more new than the 32 bit version, so

Re: Function literal bug?

2013-11-28 Thread bearophile
Sergei Nosov: Do you have a 64-bit OS at hand? On 64 bit using dmd 2.064.2 it doesn't give the 6 6 output, so it seems a 64 bit bug. This happens because the 64 bit version of dmd is quite more new than the 32 bit version, so it has more bugs. Bye, bearophile

Re: Function literal bug?

2013-11-28 Thread Sergei Nosov
On Thursday, 28 November 2013 at 08:23:22 UTC, bearophile wrote: Global structs don't need the "static" attribute. I've thought so, but added it just as a "I really mean, that I don't need context". This version of your code gives the output 6 6 on Windows 32 bit: Do you have a 64-bit OS

Re: Function literal bug?

2013-11-28 Thread bearophile
Sergei Nosov: T identity(T)(T e) { return e; } struct S(alias Func) { void call() { import std.stdio; writeln(Func("string").length); } } static struct S1 { alias S!(identity) A1; //alias S!(x => x) A2; alias S!(function string (string e) { return e; }) A3

Function literal bug?

2013-11-27 Thread Sergei Nosov
Hi! This is kind of bug report/question. I'm running Ubuntu 12.04 (x64), DMD v2.064.2 and have the following code: T identity(T)(T e) { return e; } struct S(alias Func) { void call() { import std.stdio; writeln(Func("string").length); } } static struct S1 { ali