betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

test test at gmail.com
Wed Oct 17 07:01:21 UTC 2018


test1:
--------------------
module test1;
import test2;
enum X = getR(1,3);
void main(string[] args){}

test2:
--------------------
module test2;
struct R {
         int i;
}
R[] getR(int a, int b){
         R[] r;
         r       ~= R(a);
         r       ~= R(b);
         return r;
}


to build without betterC:  ldmd2 ./test.d -I.
to build with betterC: ldmd2 ./test.d -I.  -betterC


If build without betterC, all work fine.  if with betterC:

test2.d(3): Error: TypeInfo cannot be used with -betterC





More information about the Digitalmars-d-learn mailing list