Skip to content

Commit f3444e8

Browse files
committed
Migrate to nullable ref types
1 parent 9e240e0 commit f3444e8

39 files changed

+581
-726
lines changed

AssemblyToProcess/AssemblyToProcess.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
</ItemGroup>
1111
<ItemGroup>
1212
<PackageReference Include="xunit" Version="2.4.1" />
13-
<PackageReference Include="Fody" Version="6.0.0" PrivateAssets="All" />
14-
<PackageReference Include="PropertyChanged.Fody" Version="3.1.3" PrivateAssets="All" />
15-
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" PrivateAssets="All" />
16-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All" />
13+
<PackageReference Include="Fody" Version="6.1.1" PrivateAssets="All" />
14+
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8" PrivateAssets="All" />
15+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" PrivateAssets="All" />
1716
</ItemGroup>
1817
<ItemGroup>
1918
<Reference Include="System.ComponentModel.Composition" />

AssemblyToProcess/ClassWithAutoPropertiesInitializedInSeparateMethod.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using AutoProperties;
2+
// ReSharper disable CheckNamespace
3+
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
24

35
public class ClassWithAutoPropertiesInitializedInSeparateMethod : ObservableObject
46
{

AssemblyToProcess/ClassWithAutoPropertyInitAndGenericBase.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
using System.Reflection;
33

44
using AutoProperties;
5+
// ReSharper disable CheckNamespace
6+
// ReSharper disable UnusedMember.Global
7+
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
58

69
public class GenericBaseClass<T>
710
{
@@ -15,13 +18,14 @@ public void Temp(T x)
1518
}
1619

1720
[SetInterceptor]
18-
protected void SetValue<T>(string name, Type propertyType, PropertyInfo propertyInfo, object newValue, T genericNewValue, ref T refToBackingField)
21+
// ReSharper disable once RedundantAssignment
22+
protected void SetValue<T1>(string name, Type propertyType, PropertyInfo propertyInfo, object newValue, T1 genericNewValue, ref T1 refToBackingField)
1923
{
2024
refToBackingField = genericNewValue;
2125
}
2226

2327
[GetInterceptor]
24-
protected T GetValue<T>(string name, Type propertyType, PropertyInfo propertyInfo, object fieldValue, T genericFieldValue, ref T refToBackingField)
28+
protected T1 GetValue<T1>(string name, Type propertyType, PropertyInfo propertyInfo, object fieldValue, T1 genericFieldValue, ref T1 refToBackingField)
2529
{
2630
return genericFieldValue;
2731
}

AssemblyToProcess/ClassWithExplicitInitializedAutoPropertiesDerivedProperDesign.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AutoProperties;
2+
// ReSharper disable CheckNamespace
23

34
public class ClassWithExplicitInitializedAutoPropertiesDerivedProperDesign : ClassWithExplicitInitializedAutoProperties
45
{

AssemblyToProcess/ClassWithExplicitInitializedAutoPropertiesDerivedWeakDesign.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AutoProperties;
2+
// ReSharper disable CheckNamespace
23

34
public class ClassWithExplicitInitializedAutoPropertiesDerivedWeakDesign : ClassWithExplicitInitializedAutoProperties
45
{

AssemblyToProcess/ClassWithExplicitInitializedBackingFieldProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AutoProperties;
2+
// ReSharper disable CheckNamespace
23

34
public class ClassWithExplicitInitializedBackingFieldProperties : ObservableObject
45
{

AssemblyToProcess/ClassWithInlineInitializedAutoProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AutoProperties;
2+
// ReSharper disable CheckNamespace
23

34
public class ClassWithInlineInitializedAutoProperties : ObservableObject
45
{

AssemblyToProcess/FodyWeavers.xsd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
3232
</xs:annotation>
3333
</xs:attribute>
34+
<xs:attribute name="SuppressWarnings" type="xs:boolean">
35+
<xs:annotation>
36+
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
37+
</xs:annotation>
38+
</xs:attribute>
39+
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
40+
<xs:annotation>
41+
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
42+
</xs:annotation>
43+
</xs:attribute>
3444
</xs:complexType>
3545
</xs:element>
3646
</xs:all>

AssemblyToProcess/InterceptorSample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
// ReSharper disable all
2+
using System;
23
using System.Configuration;
34
using System.Reflection;
45

AssemblyToProcess/Interceptors.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
using System;
1+
// ReSharper disable all
2+
using System;
23
using System.Reflection;
34

45
using AutoProperties;
56

67
using TestLibrary;
78

8-
// ReSharper disable UnusedMember.Local
9-
// ReSharper disable UnusedParameter.Local
10-
// ReSharper disable PossibleNullReferenceException
11-
// ReSharper disable AssignNullToNotNullAttribute
12-
139
public class ClassWithSimpleInterceptors
1410
{
1511
private int _field = 42;

0 commit comments

Comments
 (0)