Skip to content

Commit 96f61b8

Browse files
committed
build: treat warnings as errors; fix CS0419 cref ambiguity
Enable TreatWarningsAsErrors across the build. The code-fix project vendored its own copies of the shared helpers/extensions in the same namespaces as the generator (ReactiveUI.SourceGenerators.Helpers / .Extensions), so the test project — which references both assemblies — saw two metadata copies of each type and the doc-comment cref binder (which ignores accessibility) reported CS0419. - Move the code-fix project's vendored helpers/extensions under ReactiveUI.SourceGenerators.CodeFixers.Helpers / .Extensions so the type identities no longer collide with the generator's. - Fully-qualify the SymbolExtensionTests crefs that collided with the Microsoft.CodeAnalysis.ISymbolExtensions/ITypeSymbolExtensions types. Whole solution builds warning-clean with -warnaserror; 891 tests pass on net8/9/10.
1 parent 3c0aa37 commit 96f61b8

8 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<LangVersion>preview</LangVersion>
2929
<EnableNETAnalyzers>True</EnableNETAnalyzers>
3030
<AnalysisLevel>latest</AnalysisLevel>
31-
<WarningsAsErrors>nullable</WarningsAsErrors>
31+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3232
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3333
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
3434
<PublishRepositoryUrl>true</PublishRepositoryUrl>

src/ReactiveUI.SourceGenerator.Tests/UnitTests/SymbolExtensionTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
namespace ReactiveUI.SourceGenerator.Tests;
99

1010
/// <summary>
11-
/// Unit tests for <see cref="ISymbolExtensions"/>, <see cref="ITypeSymbolExtensions"/>,
12-
/// <see cref="INamedTypeSymbolExtensions"/>, and <see cref="CompilationExtensions"/>.
11+
/// Unit tests for <see cref="ReactiveUI.SourceGenerators.Extensions.ISymbolExtensions"/>,
12+
/// <see cref="ReactiveUI.SourceGenerators.Extensions.ITypeSymbolExtensions"/>,
13+
/// <see cref="ReactiveUI.SourceGenerators.Extensions.INamedTypeSymbolExtensions"/>, and
14+
/// <see cref="ReactiveUI.SourceGenerators.Extensions.CompilationExtensions"/>.
1315
/// All tests compile small in-memory programs to obtain real Roslyn symbol instances.
1416
/// </summary>
1517
public sealed class SymbolExtensionTests

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Extensions/FieldSyntaxExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using Microsoft.CodeAnalysis;
77

8-
namespace ReactiveUI.SourceGenerators.Extensions;
8+
namespace ReactiveUI.SourceGenerators.CodeFixers.Extensions;
99

1010
internal static class FieldSyntaxExtensions
1111
{

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Extensions/ISymbolExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using Microsoft.CodeAnalysis;
77

8-
namespace ReactiveUI.SourceGenerators.Extensions;
8+
namespace ReactiveUI.SourceGenerators.CodeFixers.Extensions;
99

1010
/// <summary>
1111
/// Extension methods for the <see cref="ISymbol"/> type.

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Extensions/ITypeSymbolExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
using System;
77
using Microsoft.CodeAnalysis;
8-
using ReactiveUI.SourceGenerators.Helpers;
8+
using ReactiveUI.SourceGenerators.CodeFixers.Helpers;
99

10-
namespace ReactiveUI.SourceGenerators.Extensions;
10+
namespace ReactiveUI.SourceGenerators.CodeFixers.Extensions;
1111

1212
/// <summary>
1313
/// Extension methods for the <see cref="ITypeSymbol"/> type.

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Helpers/EquatableArray{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Linq;
1212
using System.Runtime.CompilerServices;
1313

14-
namespace ReactiveUI.SourceGenerators.Helpers;
14+
namespace ReactiveUI.SourceGenerators.CodeFixers.Helpers;
1515

1616
/// <summary>
1717
/// An immutable, equatable array. This is equivalent to <see cref="ImmutableArray{T}"/> but with value equality support.

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Helpers/ImmutableArrayBuilder{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Diagnostics.CodeAnalysis;
1212
using System.Runtime.CompilerServices;
1313

14-
namespace ReactiveUI.SourceGenerators.Helpers;
14+
namespace ReactiveUI.SourceGenerators.CodeFixers.Helpers;
1515

1616
/// <summary>
1717
/// A helper type to build sequences of values with pooled buffers.

src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Diagnostics/CodeFixers/PropertyToReactiveFieldAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Microsoft.CodeAnalysis.CSharp;
1111
using Microsoft.CodeAnalysis.CSharp.Syntax;
1212
using Microsoft.CodeAnalysis.Diagnostics;
13-
using ReactiveUI.SourceGenerators.Extensions;
13+
using ReactiveUI.SourceGenerators.CodeFixers.Extensions;
1414
using static ReactiveUI.SourceGenerators.CodeFixers.Diagnostics.DiagnosticDescriptors;
1515

1616
namespace ReactiveUI.SourceGenerators.CodeFixers;

0 commit comments

Comments
 (0)