https://d.puremagic.com/issues/show_bug.cgi?id=12282
--- Comment #3 from [email protected] 2014-03-09 14:37:18 PDT --- (In reply to comment #2) > If you have a function like this: > > int[] array(scope const int[] a) pure {} > > Or even like this: > > int[] array(scope int[] a) pure {} > > The input is const, so it can't be mutated, Isn't it only const with "in" ? Not that it makes an actual difference here. > Is this enough to be able to cast the result to immutable? Actually, maybe. It's the "help from the compiler, and the language itself" I was talking about, and the "noalias" type qualifier. > ints don't have indirections, and > "scope" once implemented means the input data can't escape the array function. I'm not fluent with how `scope` would work, but I fear it would not work for generic types, which may themselves have indirections. Would this be legal? Or would it violate the "scope" constraint? int*[] array(scope int*[] a) pure {} -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
