[Issue 6235] New: Regression(DMD 2.053) ICE on typeof(Range.init[0..$]) inside a templated struct/class
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 1 13:56:56 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6235
Summary: Regression(DMD 2.053) ICE on typeof(Range.init[0..$])
inside a templated struct/class
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: ice-on-valid-code
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: sandford at jhu.edu
--- Comment #0 from Rob Jacques <sandford at jhu.edu> 2011-07-01 13:51:56 PDT ---
This is a regression between DMD 2.052 and DMD 2.053. Here is a very reduced
test case:
struct Bug(Range) { pragma(msg, typeof(Range.init[0..$]) ); }
void main(string[] args) {
Bug!(ubyte[]) bug;
}
The issue also effect classes and is statements, i.e.
enum useSlicing = is(typeof(Range.init[0..$]) : const ubyte[] );
This problem seems to be limited to the use of a template parameter inside a
struct/class defined outside of the current scope. All of the following
compile:
void main(string[] args) {
pragma(msg, typeof((ubyte[]).init[0..$]) );
alias ubyte[] Range;
pragma(msg, typeof(Range.init[0..$]) );
struct NotBug(Range2) { pragma(msg, typeof(Range2.init[0..$]) ); }
NotBug!(ubyte[]) notBug;
}
This bug can be worked around by placing the statement inside its own
sub-template. I.e:
struct Bug(Range) {
template UseSlicing(__Range) {
enum UseSlicing = is(typeof(__Range.init[0..$]) : const ubyte[] );
}
pragma(msg, UseSlicing!Range);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list