class Foo(T) { void bar() {} } const(Foo!(int)) foo = new Foo!(int)(); foo.bar(); It's working, but it should fail with: Error: foo.bar can only be called on a mutable object
Unsure of the version this was fixed, but it works as of 2.041.