bug : consecutive function calls and -inline

noob-is-noob noob at gmail.com
Fri May 23 14:37:09 PDT 2008


sorry if it has been discussed.
===code===
module evbug ;
import std.stdio ;

struct S(T) {
  T[] arr ;
  S!(T) opCall(T a) {
    arr ~= a ;
    writefln("%s ", arr) ;
    return *this ;
  }
}

void main() {
  S!(string) t ;
  t("AAA")("BBB")("CCC") ;
  t("<-result") ;
}
===output=== v2.014 (similar result for v1.030)
1/ compiled with -inline, ok:
[AAA]
[AAA BBB]
[AAA BBB CCC]
[AAA BBB CCC <-result]

2/ compiled w/o -inline, ng:
[AAA]
[AAA BBB]
[AAA BBB CCC]
[AAA <-result]


More information about the Digitalmars-d-learn mailing list