> http://pastebin.com/34sbffSa
Your problem comes from lengthSquared: public auto lengthSquared = function () => val.reduce!((a,b) => a + b*b); That's an unusual way to define a method. Any reason why you are using a pointer to a function as a member? Do you need to be able to redefine it at runtime? I guess that in this case, the compiler cannot determine its return type and/or its size? I'd use: public auto lengthSquared () { return val.reduce!((a,b) => a + b*b);}