@@ -490,7 +490,7 @@ private static void AnalyzeManagedTypeMarshallingInfo(SymbolAnalysisContext cont
490490 type . ToDisplayString ( ) ) ) ;
491491 }
492492
493- ( bool hasCustomTypeMarshallerAttribute , ITypeSymbol ? marshallerManagedType , _ ) = ManualTypeMarshallingHelper . GetMarshallerShapeInfo ( marshallerType ) ;
493+ ( bool hasCustomTypeMarshallerAttribute , ITypeSymbol ? marshallerManagedType , _ ) = ManualTypeMarshallingHelper_V1 . GetMarshallerShapeInfo ( marshallerType ) ;
494494
495495 marshallerManagedType = ManualTypeMarshallingHelper . ResolveManagedType ( marshallerManagedType , marshallerType , context . Compilation ) ;
496496
@@ -534,7 +534,7 @@ private static bool TypeSymbolsConstructedFromEqualTypes(ITypeSymbol left, IType
534534 public void AnalyzeMarshallerType ( SymbolAnalysisContext context )
535535 {
536536 INamedTypeSymbol marshallerType = ( INamedTypeSymbol ) context . Symbol ;
537- ( bool hasCustomTypeMarshallerAttribute , ITypeSymbol ? type , CustomTypeMarshallerData ? marshallerDataMaybe ) = ManualTypeMarshallingHelper . GetMarshallerShapeInfo ( marshallerType ) ;
537+ ( bool hasCustomTypeMarshallerAttribute , ITypeSymbol ? type , CustomTypeMarshallerData_V1 ? marshallerDataMaybe ) = ManualTypeMarshallingHelper_V1 . GetMarshallerShapeInfo ( marshallerType ) ;
538538 type = ManualTypeMarshallingHelper . ResolveManagedType ( type , marshallerType , context . Compilation ) ;
539539
540540 if ( ! hasCustomTypeMarshallerAttribute )
@@ -583,12 +583,12 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
583583 continue ;
584584 }
585585
586- if ( inConstructor is null && ManualTypeMarshallingHelper . IsManagedToNativeConstructor ( ctor , type , marshallerData . Kind ) )
586+ if ( inConstructor is null && ManualTypeMarshallingHelper_V1 . IsManagedToNativeConstructor ( ctor , type , marshallerData . Kind ) )
587587 {
588588 inConstructor = ctor ;
589589 }
590590
591- if ( callerAllocatedSpanConstructor is null && ManualTypeMarshallingHelper . IsCallerAllocatedSpanConstructor ( ctor , type , _spanOfT , marshallerData . Kind , out _ ) )
591+ if ( callerAllocatedSpanConstructor is null && ManualTypeMarshallingHelper_V1 . IsCallerAllocatedSpanConstructor ( ctor , type , _spanOfT , marshallerData . Kind , out _ ) )
592592 {
593593 callerAllocatedSpanConstructor = ctor ;
594594 }
@@ -653,30 +653,30 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
653653 }
654654 }
655655
656- if ( marshallerData . Direction . HasFlag ( CustomTypeMarshallerDirection . Out ) && ! ManualTypeMarshallingHelper . HasToManagedMethod ( marshallerType , type ) )
656+ if ( marshallerData . Direction . HasFlag ( CustomTypeMarshallerDirection . Out ) && ! ManualTypeMarshallingHelper_V1 . HasToManagedMethod ( marshallerType , type ) )
657657 {
658658 context . ReportDiagnostic (
659659 marshallerType . CreateDiagnostic (
660660 OutRequiresToManagedRule ,
661661 ImmutableDictionary < string , string > . Empty . Add (
662662 MissingMemberNames . Key ,
663- ShapeMemberNames . Value . ToManaged ) ,
663+ ShapeMemberNames_V1 . Value . ToManaged ) ,
664664 marshallerType . ToDisplayString ( ) ) ) ;
665665 }
666666
667667 if ( marshallerData . Kind == CustomTypeMarshallerKind . LinearCollection )
668668 {
669- IMethodSymbol ? getManagedValuesSourceMethod = ManualTypeMarshallingHelper . FindGetManagedValuesSourceMethod ( marshallerType , _readOnlySpanOfT ) ;
670- IMethodSymbol ? getManagedValuesDestinationMethod = ManualTypeMarshallingHelper . FindGetManagedValuesDestinationMethod ( marshallerType , _spanOfT ) ;
671- IMethodSymbol ? getNativeValuesSourceMethod = ManualTypeMarshallingHelper . FindGetNativeValuesSourceMethod ( marshallerType , _readOnlySpanOfByte ) ;
672- IMethodSymbol ? getNativeValuesDestinationMethod = ManualTypeMarshallingHelper . FindGetNativeValuesDestinationMethod ( marshallerType , _spanOfByte ) ;
669+ IMethodSymbol ? getManagedValuesSourceMethod = ManualTypeMarshallingHelper_V1 . FindGetManagedValuesSourceMethod ( marshallerType , _readOnlySpanOfT ) ;
670+ IMethodSymbol ? getManagedValuesDestinationMethod = ManualTypeMarshallingHelper_V1 . FindGetManagedValuesDestinationMethod ( marshallerType , _spanOfT ) ;
671+ IMethodSymbol ? getNativeValuesSourceMethod = ManualTypeMarshallingHelper_V1 . FindGetNativeValuesSourceMethod ( marshallerType , _readOnlySpanOfByte ) ;
672+ IMethodSymbol ? getNativeValuesDestinationMethod = ManualTypeMarshallingHelper_V1 . FindGetNativeValuesDestinationMethod ( marshallerType , _spanOfByte ) ;
673673 if ( marshallerData . Direction . HasFlag ( CustomTypeMarshallerDirection . In ) && ( getManagedValuesSourceMethod is null || getNativeValuesDestinationMethod is null ) )
674674 {
675675 var missingMembers = ( getManagedValuesSourceMethod , getNativeValuesDestinationMethod ) switch
676676 {
677- ( null , not null ) => ShapeMemberNames . LinearCollection . GetManagedValuesSource ,
678- ( not null , null ) => ShapeMemberNames . LinearCollection . GetNativeValuesDestination ,
679- ( null , null ) => $ "{ ShapeMemberNames . LinearCollection . GetManagedValuesSource } { MissingMemberNames . Delimiter } { ShapeMemberNames . LinearCollection . GetNativeValuesDestination } ",
677+ ( null , not null ) => ShapeMemberNames_V1 . LinearCollection . GetManagedValuesSource ,
678+ ( not null , null ) => ShapeMemberNames_V1 . LinearCollection . GetNativeValuesDestination ,
679+ ( null , null ) => $ "{ ShapeMemberNames_V1 . LinearCollection . GetManagedValuesSource } { MissingMemberNames . Delimiter } { ShapeMemberNames_V1 . LinearCollection . GetNativeValuesDestination } ",
680680 ( not null , not null ) => string . Empty
681681 } ;
682682 context . ReportDiagnostic (
@@ -692,9 +692,9 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
692692 {
693693 var missingMembers = ( getNativeValuesSourceMethod , getManagedValuesDestinationMethod ) switch
694694 {
695- ( not null , null ) => ShapeMemberNames . LinearCollection . GetNativeValuesSource ,
696- ( null , not null ) => ShapeMemberNames . LinearCollection . GetManagedValuesDestination ,
697- ( null , null ) => $ "{ ShapeMemberNames . LinearCollection . GetNativeValuesSource } { MissingMemberNames . Delimiter } { ShapeMemberNames . LinearCollection . GetManagedValuesDestination } ",
695+ ( not null , null ) => ShapeMemberNames_V1 . LinearCollection . GetNativeValuesSource ,
696+ ( null , not null ) => ShapeMemberNames_V1 . LinearCollection . GetManagedValuesDestination ,
697+ ( null , null ) => $ "{ ShapeMemberNames_V1 . LinearCollection . GetNativeValuesSource } { MissingMemberNames . Delimiter } { ShapeMemberNames_V1 . LinearCollection . GetManagedValuesDestination } ",
698698 ( not null , not null ) => string . Empty
699699 } ;
700700 context . ReportDiagnostic (
@@ -736,18 +736,18 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
736736 marshallerType . ToDisplayString ( ) ) ) ;
737737 }
738738
739- if ( marshallerData . Features . HasFlag ( CustomTypeMarshallerFeatures . UnmanagedResources ) && ! ManualTypeMarshallingHelper . HasFreeNativeMethod ( marshallerType ) )
739+ if ( marshallerData . Features . HasFlag ( CustomTypeMarshallerFeatures . UnmanagedResources ) && ! ManualTypeMarshallingHelper_V1 . HasFreeNativeMethod ( marshallerType ) )
740740 {
741741 context . ReportDiagnostic (
742742 marshallerType . CreateDiagnostic (
743743 UnmanagedResourcesRequiresFreeNativeRule ,
744744 ImmutableDictionary < string , string > . Empty . Add (
745745 MissingMemberNames . Key ,
746- ShapeMemberNames . Value . FreeNative ) ,
746+ ShapeMemberNames_V1 . Value . FreeNative ) ,
747747 marshallerType . ToDisplayString ( ) ,
748748 type . ToDisplayString ( ) ) ) ;
749749 }
750- else if ( ! marshallerData . Features . HasFlag ( CustomTypeMarshallerFeatures . UnmanagedResources ) && ManualTypeMarshallingHelper . HasFreeNativeMethod ( marshallerType ) )
750+ else if ( ! marshallerData . Features . HasFlag ( CustomTypeMarshallerFeatures . UnmanagedResources ) && ManualTypeMarshallingHelper_V1 . HasFreeNativeMethod ( marshallerType ) )
751751 {
752752 context . ReportDiagnostic (
753753 marshallerType . CreateDiagnostic (
@@ -758,8 +758,8 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
758758 marshallerType . ToDisplayString ( ) ) ) ;
759759 }
760760
761- IMethodSymbol ? toNativeValueMethod = ManualTypeMarshallingHelper . FindToNativeValueMethod ( marshallerType ) ;
762- IMethodSymbol ? fromNativeValueMethod = ManualTypeMarshallingHelper . FindFromNativeValueMethod ( marshallerType ) ;
761+ IMethodSymbol ? toNativeValueMethod = ManualTypeMarshallingHelper_V1 . FindToNativeValueMethod ( marshallerType ) ;
762+ IMethodSymbol ? fromNativeValueMethod = ManualTypeMarshallingHelper_V1 . FindFromNativeValueMethod ( marshallerType ) ;
763763 bool toNativeValueMethodIsRefReturn = toNativeValueMethod is { ReturnsByRef : true } or { ReturnsByRefReadonly : true } ;
764764 ITypeSymbol nativeType = marshallerType ;
765765
@@ -771,7 +771,7 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
771771 InTwoStageMarshallingRequiresToNativeValueRule ,
772772 ImmutableDictionary < string , string > . Empty . Add (
773773 MissingMemberNames . Key ,
774- ShapeMemberNames . Value . ToNativeValue ) ,
774+ ShapeMemberNames_V1 . Value . ToNativeValue ) ,
775775 marshallerType . ToDisplayString ( ) ) ) ;
776776 }
777777 if ( marshallerData . Direction . HasFlag ( CustomTypeMarshallerDirection . Out ) && fromNativeValueMethod is null )
@@ -780,7 +780,7 @@ public void AnalyzeMarshallerType(SymbolAnalysisContext context)
780780 OutTwoStageMarshallingRequiresFromNativeValueRule ,
781781 ImmutableDictionary < string , string > . Empty . Add (
782782 MissingMemberNames . Key ,
783- ShapeMemberNames . Value . FromNativeValue ) ,
783+ ShapeMemberNames_V1 . Value . FromNativeValue ) ,
784784 marshallerType . ToDisplayString ( ) ) ) ;
785785 }
786786
0 commit comments