File tree Expand file tree Collapse file tree 2 files changed +5
-19
lines changed
src/Datadog.Trace.Tools.Analyzers/SealedAnalyzer
test/Datadog.Trace.Tools.Analyzers.Tests/SealedAnalyzer Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ private static void OnCompilationStart(CompilationStartAnalysisContext context)
3636 var attributesToMatch = new [ ]
3737 {
3838 context . Compilation . GetOrCreateTypeByMetadataName ( "System.Runtime.InteropServices.ComImportAttribute" ) ,
39- context . Compilation . GetOrCreateTypeByMetadataName ( "Datadog.Trace.DuckTyping.DuckTypeAttribute" )
4039 } ;
4140
4241 var candidateTypes = PooledConcurrentSet < INamedTypeSymbol > . GetInstance ( SymbolEqualityComparer . Default ) ;
Original file line number Diff line number Diff line change @@ -215,31 +215,18 @@ public async Task UnsealedNestedClassTwoDeep_Diagnostic(
215215
216216 [ Theory ]
217217 [ CombinatorialData ]
218- public async Task DuckTypeAttributedType_NoDiagnostic (
219- [ CombinatorialMemberData ( nameof ( NonPrivateModifiers ) ) ] string modifier ,
220- [ CombinatorialMemberData ( nameof ( ClassTypes ) ) ] string type )
218+ public async Task AttributedType_NoDiagnostic (
219+ [ CombinatorialMemberData ( nameof ( NonPrivateModifiers ) ) ] string modifier )
221220 {
222221 var source =
223222 $$ """
224223 using System;
225- using Datadog.Trace.DuckTyping;
226224
227- [Datadog.Trace.DuckTyping.DuckType("Sometype", "SomeAssembly") ]
228- [DuckType("Sometype", "SomeAssembly ")]
229- {{ modifier }} {{ type }} C
225+ [System.Runtime.InteropServices.ComImport ]
226+ [System.Runtime.InteropServices.Guid("E8D59775-E821-4D6C-B63D-BB0D969361DA ")]
227+ {{ modifier }} class C
230228 {
231229 }
232-
233- namespace Datadog.Trace.DuckTyping
234- {
235- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true)]
236- internal sealed class DuckTypeAttribute(string targetType, string targetAssembly) : Attribute
237- {
238- public string? TargetType { get; set; } = targetType;
239-
240- public string? TargetAssembly { get; set; } = targetAssembly;
241- }
242- }
243230 """ ;
244231
245232 await Verifier . VerifyAnalyzerAsync ( source ) ; // no diagnostics expected
You can’t perform that action at this time.
0 commit comments