September 18, 2009 [Issue 3330] New: Compiler rejects mixin templates that generate moderately long code; | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=3330 Summary: Compiler rejects mixin templates that generate moderately long code; Product: D Version: 2.032 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: peng2cheng2@yahoo.com --- Comment #0 from pc <peng2cheng2@yahoo.com> 2009-09-18 14:20:21 PDT --- Created an attachment (id=458) 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 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 06, 2009 [Issue 3330] Compiler rejects mixin templates that generate moderately long code; | ||||
---|---|---|---|---|
| ||||
Posted in reply to pc | http://d.puremagic.com/issues/show_bug.cgi?id=3330 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |INVALID --- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2009-12-06 03:55:43 PST --- Test case fails to compile with: bug.d(11): Error: identifier 'SqlDate' is not defined Please fix & reopen. -- 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