The immutable is not necessary, use: auto h = new Parser!(Type.request)("Hello world");
Otherwise, if you really want to declare the type instead of infering it you can write: Parser!(Type.request) h = new Parser!(Type.request)("Hello world"); You can also do: Parser!(Type.request) h; h = new typeof(h)("Hello world"); or: alias Parser!(Type.request) ParseRequest; ParseRequest h = new ParseRequest("Hello world"); Also, 'static' on the enum declaration doesn't really do anything. :)