-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[c#] Add support for System.Collections.Immutable collections
Co-authored-by: Christopher Warrington <chwarr@microsoft.com>
- Loading branch information
Showing
19 changed files
with
448 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
compiler/tests/generated/collection-interfaces/immutable_collections_types.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
|
||
// suppress "Missing XML comment for publicly visible type or member" | ||
#pragma warning disable 1591 | ||
|
||
|
||
#region ReSharper warnings | ||
// ReSharper disable PartialTypeWithSinglePart | ||
// ReSharper disable RedundantNameQualifier | ||
// ReSharper disable InconsistentNaming | ||
// ReSharper disable CheckNamespace | ||
// ReSharper disable UnusedParameter.Local | ||
// ReSharper disable RedundantUsingDirective | ||
#endregion | ||
|
||
namespace tests | ||
{ | ||
using System.Collections.Generic; | ||
|
||
[global::Bond.Schema] | ||
[System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] | ||
public partial class ImmutableCollectionsHolder | ||
{ | ||
[global::Bond.Id(0)] | ||
public System.Collections.Immutable.ImmutableArray<string> ImmutableArrayString { get; set; } | ||
|
||
[global::Bond.Id(1)] | ||
public System.Collections.Immutable.ImmutableList<string> ImmutableListString { get; set; } | ||
|
||
[global::Bond.Id(2)] | ||
public System.Collections.Immutable.ImmutableHashSet<string> ImmutableHashSetString { get; set; } | ||
|
||
[global::Bond.Id(3)] | ||
public System.Collections.Immutable.ImmutableSortedSet<int> ImmutableSortedSetInt { get; set; } | ||
|
||
[global::Bond.Id(4)] | ||
public System.Collections.Immutable.ImmutableDictionary<string,string> ImmutableDictionaryStringMap { get; set; } | ||
|
||
[global::Bond.Id(5)] | ||
public System.Collections.Immutable.ImmutableSortedDictionary<int,string> ImmutableSortedDictionaryStringMap { get; set; } | ||
|
||
public ImmutableCollectionsHolder() | ||
: this("tests.ImmutableCollectionsHolder", "ImmutableCollectionsHolder") | ||
{} | ||
|
||
protected ImmutableCollectionsHolder(string fullName, string name) | ||
{ | ||
ImmutableArrayString = System.Collections.Immutable.ImmutableArray<string>.Empty; | ||
ImmutableListString = System.Collections.Immutable.ImmutableList<string>.Empty; | ||
ImmutableHashSetString = System.Collections.Immutable.ImmutableHashSet<string>.Empty; | ||
ImmutableSortedSetInt = System.Collections.Immutable.ImmutableSortedSet<int>.Empty; | ||
ImmutableDictionaryStringMap = System.Collections.Immutable.ImmutableDictionary<string,string>.Empty; | ||
ImmutableSortedDictionaryStringMap = System.Collections.Immutable.ImmutableSortedDictionary<int,string>.Empty; | ||
} | ||
} | ||
} // tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
|
||
// suppress "Missing XML comment for publicly visible type or member" | ||
#pragma warning disable 1591 | ||
|
||
|
||
#region ReSharper warnings | ||
// ReSharper disable PartialTypeWithSinglePart | ||
// ReSharper disable RedundantNameQualifier | ||
// ReSharper disable InconsistentNaming | ||
// ReSharper disable CheckNamespace | ||
// ReSharper disable UnusedParameter.Local | ||
// ReSharper disable RedundantUsingDirective | ||
#endregion | ||
|
||
namespace tests | ||
{ | ||
using System.Collections.Generic; | ||
|
||
[global::Bond.Schema] | ||
[System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] | ||
public partial class ImmutableCollectionsHolder | ||
{ | ||
[global::Bond.Id(0)] | ||
public System.Collections.Immutable.ImmutableArray<string> ImmutableArrayString { get; set; } | ||
|
||
[global::Bond.Id(1)] | ||
public System.Collections.Immutable.ImmutableList<string> ImmutableListString { get; set; } | ||
|
||
[global::Bond.Id(2)] | ||
public System.Collections.Immutable.ImmutableHashSet<string> ImmutableHashSetString { get; set; } | ||
|
||
[global::Bond.Id(3)] | ||
public System.Collections.Immutable.ImmutableSortedSet<int> ImmutableSortedSetInt { get; set; } | ||
|
||
[global::Bond.Id(4)] | ||
public System.Collections.Immutable.ImmutableDictionary<string,string> ImmutableDictionaryStringMap { get; set; } | ||
|
||
[global::Bond.Id(5)] | ||
public System.Collections.Immutable.ImmutableSortedDictionary<int,string> ImmutableSortedDictionaryStringMap { get; set; } | ||
|
||
public ImmutableCollectionsHolder() | ||
: this("tests.ImmutableCollectionsHolder", "ImmutableCollectionsHolder") | ||
{} | ||
|
||
protected ImmutableCollectionsHolder(string fullName, string name) | ||
{ | ||
ImmutableArrayString = System.Collections.Immutable.ImmutableArray<string>.Empty; | ||
ImmutableListString = System.Collections.Immutable.ImmutableList<string>.Empty; | ||
ImmutableHashSetString = System.Collections.Immutable.ImmutableHashSet<string>.Empty; | ||
ImmutableSortedSetInt = System.Collections.Immutable.ImmutableSortedSet<int>.Empty; | ||
ImmutableDictionaryStringMap = System.Collections.Immutable.ImmutableDictionary<string,string>.Empty; | ||
ImmutableSortedDictionaryStringMap = System.Collections.Immutable.ImmutableSortedDictionary<int,string>.Empty; | ||
} | ||
} | ||
} // tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace tests | ||
|
||
using ImmutableArray<T> = list<T>; | ||
using ImmutableList<T> = list<T>; | ||
using ImmutableHashSet<T> = set<T>; | ||
using ImmutableSortedSet<T> = set<T>; | ||
using ImmutableDictionary<K, V> = map<K, V>; | ||
using ImmutableSortedDictionary<K, V> = map<K, V>; | ||
|
||
struct ImmutableCollectionsHolder | ||
{ | ||
0: ImmutableArray<string> ImmutableArrayString; | ||
1: ImmutableList<string> ImmutableListString; | ||
2: ImmutableHashSet<string> ImmutableHashSetString; | ||
3: ImmutableSortedSet<int32> ImmutableSortedSetInt; | ||
4: ImmutableDictionary<string, string> ImmutableDictionaryStringMap; | ||
5: ImmutableSortedDictionary<int32, string> ImmutableSortedDictionaryStringMap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.