@@ -2186,7 +2186,7 @@ private static ObjectCreationExpressionSyntax GuidValue(CustomAttribute guidAttr
21862186                Argument ( LiteralExpression ( SyntaxKind . NumericLiteralExpression ,  Literal ( ToHex ( k ) ,  k ) ) ) ) ; 
21872187        } 
21882188
2189-         private  static ObjectCreationExpressionSyntax  PropertyKeyValue ( CustomAttribute  propertyKeyAttribute ) 
2189+         private  static ObjectCreationExpressionSyntax  PropertyKeyValue ( CustomAttribute  propertyKeyAttribute ,   TypeSyntax   type ) 
21902190        { 
21912191            CustomAttributeValue < TypeSyntax >  args  =  propertyKeyAttribute . DecodeValue ( CustomAttributeTypeProvider . Instance ) ; 
21922192            var  a  =  ( uint ) args . FixedArguments [ 0 ] . Value ! ; 
@@ -2202,7 +2202,7 @@ private static ObjectCreationExpressionSyntax PropertyKeyValue(CustomAttribute p
22022202            var  k  =  ( byte ) args . FixedArguments [ 10 ] . Value ! ; 
22032203            var  pid  =  ( uint ) args . FixedArguments [ 11 ] . Value ! ; 
22042204
2205-             return  ObjectCreationExpression ( IdentifierName ( "global::Windows.Win32.UI.Shell.PropertiesSystem.PROPERTYKEY" ) ) . WithInitializer ( 
2205+             return  ObjectCreationExpression ( type ) . WithInitializer ( 
22062206                InitializerExpression ( SyntaxKind . ObjectInitializerExpression ,  SeparatedList < ExpressionSyntax > ( new [ ] 
22072207                { 
22082208                    AssignmentExpression ( SyntaxKind . SimpleAssignmentExpression ,  IdentifierName ( "fmtid" ) ,  GuidValue ( propertyKeyAttribute ) ) , 
@@ -2878,7 +2878,7 @@ private FieldDeclarationSyntax DeclareConstant(FieldDefinitionHandle fieldDefHan
28782878                ExpressionSyntax  value  = 
28792879                    fieldDef . GetDefaultValue ( )  is  {  IsNil :  false  }  constantHandle  ?  this . ToExpressionSyntax ( this . Reader . GetConstant ( constantHandle ) )  : 
28802880                    this . FindInteropDecorativeAttribute ( customAttributes ,  nameof ( GuidAttribute ) )  is  CustomAttribute  guidAttribute  ?  GuidValue ( guidAttribute )  : 
2881-                     this . FindInteropDecorativeAttribute ( customAttributes ,  "PropertyKeyAttribute" )  is  CustomAttribute  propertyKeyAttribute  ?  PropertyKeyValue ( propertyKeyAttribute )  : 
2881+                     this . FindInteropDecorativeAttribute ( customAttributes ,  "PropertyKeyAttribute" )  is  CustomAttribute  propertyKeyAttribute  ?  PropertyKeyValue ( propertyKeyAttribute ,   fieldType . Type )  : 
28822882                    throw  new  NotSupportedException ( "Unsupported constant: "  +  name ) ; 
28832883                bool  requiresUnsafe  =  false ; 
28842884                if  ( fieldType . Type  is  not PredefinedTypeSyntax  &&  value  is  not ObjectCreationExpressionSyntax ) 
0 commit comments