D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3330 - Compiler rejects mixin templates that generate moderately long code;
Summary: Compiler rejects mixin templates that generate moderately long code;
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-09-18 14:20 UTC by pc
Modified: 2015-06-09 01:26 UTC (History)
2 users (show)

See Also:


Attachments
a good mixin template(?) that dmd 2 cannot evaluate (3.69 KB, text/x-dsrc)
2009-09-18 14:20 UTC, pc
Details

Note You need to log in before you can comment on or make changes to this issue.
Description pc 2009-09-18 14:20:21 UTC
Created attachment 458 [details]
a good mixin template(?) that dmd 2 cannot evaluate

Mixin template tests out fine, except if the generated code gets moderately
long. See attached file for example. When mixin produces the longer code, the
compiler produces following.

pc_ut$> dmd dcsv_ut.d -L-lpcd2
/opt/d2/src/druntime/import/core/memory.di(162): Error: cannot evaluate
gc_malloc(sz,ba) at compile time
/opt/d2/src/phobos/std/conv.d(2517): Error: cannot evaluate malloc(12u,2u) at
compile time
/opt/d2/src/phobos/std/conv.d(2987): Error: cannot evaluate to(_param_0) at
compile time
/opt/d2/src/phobos/std/conv.d(3003): Error: cannot evaluate textImpl(_param_0)
at compile time
/home/pc/d2libs/src/pcd2/pc/dcsv.d(306): Error: cannot evaluate text(i) at
compile time
/home/pc/d2libs/src/pcd2/pc/dcsv.d(331): Error: cannot evaluate
makeCSVRowMixin("struct ChartDataRow","\x0along fld1; ostring tb_group; long
fld2; ostring fs_group; \x0along fld3; ostring fs_line; long fld4; ostring
account_group; \x0along fld5; ostring account; long acct_id; ostring
print_name;\x0a",",\"") at compile time
/home/pc/d2libs/src/pcd2/pc/dcsv.d(331): Error: argument to mixin must be a
string, not (makeCSVRowMixin("struct ChartDataRow","\x0along fld1; ostring
tb_group; long fld2; ostring fs_group; \x0along fld3; ostring fs_line; long
fld4; ostring account_group; \x0along fld5; ostring account; long acct_id;
ostring print_name;\x0a",",\""))
dcsv_ut.d(49): Error: mixin dcsv_ut.CSVRow!("struct
ChartDataRow",csvChartDataFields) error instantiating
/home/pc/d2libs/src/pcd2/pc/dcsv.d(331): Error: cannot evaluate
makeCSVRowMixin("struct XRow","long i; javastr s; double d; SqlDate dt",",\"")
at compile time
/home/pc/d2libs/src/pcd2/pc/dcsv.d(331): Error: argument to mixin must be a
string, not (makeCSVRowMixin("struct XRow","long i; javastr s; double d;
SqlDate dt",",\""))
dcsv_ut.d(52): Error: mixin dcsv_ut.CSVRow!("struct XRow","long i; javastr s;
double d; SqlDate dt") error instantiating
Comment 1 Walter Bright 2009-12-06 03:55:43 UTC
Test case fails to compile with:

bug.d(11): Error: identifier 'SqlDate' is not defined

Please fix & reopen.