If you accidentally do this when creating an AA int[int] f = {1: 1, 2: 2}; The error message is confusing: Error: comma expected separating field initializers Error: expression expected, not `:` In this case, the error message could include something to indicate that [] are used to create an associative array. It's also unclear what the error message in its current form means, since {1: 1, 2: 2} is designated initializer syntax. The only problem is that 1 and 2 are not valid names.
@royalpinto007 updated dlang/dmd pull request #16832 "fix 24745 - improve associative array syntax error message" fixing this issue: - fix Bugzilla 24745 - improve associative array syntax error message Signed-off-by: royalpinto007 <royalpinto007@gmail.com> fix 24745 - issue line Signed-off-by: royalpinto007 <royalpinto007@gmail.com> https://github.com/dlang/dmd/pull/16832
dlang/dmd pull request #16832 "fix Bugzilla 24745 - improve associative array syntax error message" was merged into master: - d4b85e9827a85bfe4f55b0fbd1c487fed7b051b9 by royalpinto007: fix Bugzilla 24745 - improve associative array syntax error message Signed-off-by: royalpinto007 <royalpinto007@gmail.com> https://github.com/dlang/dmd/pull/16832