Summary: throw ClassName.templatedStaticMethod(...) cannot be
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Kazuhiro Inaba <> 2010-11-07 01:18:51 PST ---
The following code doesn't compile (in dmd 2.050 and 1.065), but I think it

class Factory
    static Exception create(T)(T x)
        return new Exception("whatever");

void main()
    throw Factory.create(123);

Error message is the following:

> test.d(11): Error: type Factory is not an expression

Either one of the changes dissolves the compilation failure:

- Changing the method declaration into a non-template
    create(int x)
- Decomposing the throw statement as
    auto e = Factory.create(123); throw e;

The combination of throw+static+template seems causing a trouble.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to