Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356384

Summary: Add constructor to dictionary
Product: z_Archived Reporter: Matt Heitz <mheitz>
Component: EDTAssignee: Project Inbox <edt.language-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matt Heitz CLA 2011-08-31 14:36:32 EDT
Dictionary needs a constructor so you can pass in the caseSensitive and ordering values.  Presently they're annotations you can put on a field, like this:

dx dictionary{ caseSensitive = false, ordering = OrderingKind.byKey };

But if there's no field (you create the dictionary on the fly) there's no way to set caseSensitive and ordering:

processDictionary(
  // Invalid!
  new dictionary{ 
    caseSensitive = false, 
    ordering = OrderingKind.byKey, 
    key1 = value1 } );

We should have a constructor for dictionaries, as shown in this example:

processDictionary(
  new dictionary( false, OrderingKind.byKey ) { key1 = value1 } );
Comment 1 Matt Heitz CLA 2011-09-07 17:36:06 EDT

*** This bug has been marked as a duplicate of bug 357014 ***