www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17301] New: Unhelpful error message on template and

https://issues.dlang.org/show_bug.cgi?id=17301

          Issue ID: 17301
           Summary: Unhelpful error message on template and non-template
                    struct defined in separate modules
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mrsmith33 yandex.ru

module moduleA;
import moduleB;

void main() {
    HashMap!(int) map;
}
struct HashMap {}


module moduleB;
struct HashMap(Key) {}

moduleA.d(6): Error: template instance HashMap!int HashMap is not a template
declaration, it is a struct



But, when defined in one module:

void main() {
    HashMap!(int) map;
}

struct HashMap {}
struct HashMap(Key) {}

hashmap.d(6): Error: struct hashmap.HashMap(Key) conflicts with struct
hashmap.HashMap at hashmap.d(5)

--
Apr 07