On 12/22/20 5:44 PM, Daniel Kozak wrote:
On Tue, Dec 22, 2020 at 10:15 PM Andre Pany via Digitalmars-d-learn <[email protected] <mailto:[email protected]>> wrote:Hi, I am really confused, why is this valid: void sample(string[string] s = string[string].init){} while this causes syntax errors? void sample_invalid1(double[string] s = double[string].init){} void sample_invalid2(int[int] s = int[int].init){} Kind regards AndréAs has been said this is an oddity in the grammar. But why would anyone need to use this anyway?void sample_invalid2(int[int] s = int[int].init){} seems really awful to me anyway.
Yeah: void sample_valid(int[int] s = null) -Steve
