[Issue 1463] New: __traits: indexed template parsed as type, not value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 31 07:54:02 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1463
Summary: __traits: indexed template parsed as type, not value
Product: D
Version: 2.003
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: reiner.pope at gmail.com
The following code fails to compile, with error "GetMembers!() is used as a
type". Replacing the instance of i with 0 fixes it.
template GetMembers()
{
const string[] GetMembers = ["hello", "bye"];
}
const i = 0;
class Foo
{
void hello() {}
}
const f = __traits( getVirtualFunctions, Foo, GetMembers!()[i] ).length;
--
More information about the Digitalmars-d-bugs
mailing list