http://d.puremagic.com/issues/show_bug.cgi?id=4734
--- Comment #5 from Jonathan M Davis <[email protected]> 2010-08-26 15:47:47 PDT --- The error message definitely needs to be improved. However, if you're arguing for consistency, you could easily argue that the current way is not consistent because it's not consistent with variable declarations. If I declare const T foo; then foo is going to be a const T. However, if I declare const T foo() {} then now T is not const. Rather the object that foo is a member of is const. So, the current situation is _not_ completely consistent. It chooses to be consistent with one feature and not another because it can't be consistent with both. However, anyone coming from a C++ background will expect that function declaration to return a const T and that you would have to put the const to the right of the function name to make it const. This topic has come up a number of times, and there are quite a few folks who think that the current situation is flawed. There's certainly no question that it's confusing. Personally, I'd argue that function modifiers should just go on the right of the function, except that that would be confusing with regards to modifiers like private or abstract which other languages put to the left of the function. So, I'd strongly argue that it will cause fewer problems if you had to put immutable and const to the right of the function name to make the function immutable or const. Yes, it's inconsistent with other function modifiers, but it's more consistent with variable declarations and other languages., and it will causes less confusion. The other solution would be to always require parens for const and immutable types regardless of whether they're for return types or variable declarations, but I can't imagine that that would go over very well. In any case, at minimum, the error message needs to be improved. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
