[Issue 11877] New: static opSlice is not possible
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jan 7 05:01:09 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11877
Summary: static opSlice is not possible
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: public at dicebot.lv
--- Comment #0 from Dicebot <public at dicebot.lv> 2014-01-07 05:01:05 PST ---
struct X
{
static int opSlice(size_t a, size_t b)
{
return 42;
}
}
static assert ( X[1..2] == 42 );
// Error: cannot slice type 'X'
-------------------------------------------
There is not reason why slicing should be prohibited in this case. It conforms
usual operator syntax rewrite rules and has no grammar ambiguity with array
types if slicing bounds are used.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list