[Issue 9861] New: Spurious 'is used as type' error with failed template instantiation
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 2 09:31:23 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9861
Summary: Spurious 'is used as type' error with failed template
instantiation
Product: D
Version: D1 & D2
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: clugdbug at yahoo.com.au
--- Comment #0 from Don <clugdbug at yahoo.com.au> 2013-04-02 09:31:23 PDT ---
struct Foo(T, real x = T.epsilon) { }
Foo!(int) q;
--
bug.d(1): Error: no property 'epsilon' for type 'int'
bug.d(2): Error: Foo!(int) is used as a type
Well, yeah, it's used as a type. It *is* a type!
Although it is helpful to be provided with the instantiation line number.
---
struct Bar(int x) {
somegarbage xxx;
}
Bar!(7).xxx p;
---
bug.d(2): Error: undefined identifier somegarbage
bug.d(4): Error: template instance junk.Bar!(7) error instantiating
bug.d(4): Error: Bar!(7).xxx is used as a type
And in this second case, the error message is entirely useless.
--
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