Immutables: static properties were not excluded

from builder generation and were treated as instance properties.
This commit is contained in:
Carl de Billy 2018-08-23 16:35:21 -04:00
Родитель 856635d660
Коммит 30d8c0811f
2 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -237,4 +237,17 @@ namespace Uno.CodeGen.Tests
[EqualityComparerOptions(CollectionMode = CollectionComparerMode.Unsorted)]
public byte[] UnsortedBytes { get; }
}
}
[GeneratedImmutable]
public partial class ImmutableWithStaticProperties
{
public static ImmutableWithStaticProperties Version1 { get; } = Default;
public static ImmutableWithStaticProperties Version2 { get; } = Default.WithVersion(2);
public static ImmutableWithStaticProperties Version3 { get; } = Default.WithVersion(3);
[EqualityKey]
public int Version { get; } = 1;
}
}

Просмотреть файл

@ -220,7 +220,10 @@ namespace Uno
(IPropertySymbol property, bool isNew)[] properties;
var typeProperties = typeSymbol.GetProperties().ToArray();
var typeProperties = typeSymbol
.GetProperties()
.Where(p => !p.IsStatic)
.ToArray();
if (baseTypeInfo.isBaseTypePresent)
{