Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.3
-
None
Description
Allowing trailing commas in structured literals (array, set, map) as a convenient syntactic leniency.
let m = { "foo": 1, "bar": 2, }; let a = [ 1, 2, ]; let s = (1, 2, );
Using a trailing ellipsis (...) to alter the concrete class materialized as a convenient semantic shortcut.
let m = { "foo": 1, "bar": 2, ... }; // LinkedHashMap let a = [ 1, 2, ...]; // ArrayList let s = (1, 2, ...); // LinkedHashSet