[Issue 4137] New: Undefined identifier error in is(typeof())
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 1 05:38:37 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4137
Summary: Undefined identifier error in is(typeof())
Product: D
Version: unspecified
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-05-01 05:38:35 PDT ---
I don't know if there are ways to solve this problem, I hope this isn't another
situation like bug 3950.
This is wrong D2 code. The template Foo has the type parameter T while inside
it uses the parameter R:
template Foo(T) {
enum bool Foo = is(typeof(R.length));
}
void main() {
assert(Foo!(int[]));
}
The program compiles with no errors with dmd 2.043 and at run time produces:
core.exception.AssertError at test2(5): Assertion failure
But to help debugging, I'd like the compiler to point R as a undefined
identifier (even with the 'did you mean...') at compile-time. Is this possible?
--
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