@@ -527,7 +527,13 @@ private static void ApplyParameterReplacement(Delegate d, XPathNavigator functio
527527 switch ( node . Name )
528528 {
529529 case "type" :
530- d . Parameters [ i ] . CurrentType = ( string ) node . TypedValue ;
530+ string type = ( string ) node . TypedValue ;
531+ // If the replacement type has a pointer we replace the entire type
532+ // if the type doesn't we just replace the underlying type of the pointer.
533+ // - 2024-03-26 Noggin_bops
534+ if ( type . Contains ( "*" ) )
535+ d . Parameters [ i ] . Pointer = 0 ;
536+ d . Parameters [ i ] . CurrentType = type ;
531537 break ;
532538 case "name" :
533539 d . Parameters [ i ] . Name = ( string ) node . TypedValue ;
@@ -561,7 +567,19 @@ private static void ApplyReturnTypeReplacement(Delegate d, XPathNavigator functi
561567 XPathNavigator return_override = function_override . SelectSingleNode ( "returns" ) ;
562568 if ( return_override != null )
563569 {
570+ // If the replacement type has a pointer we replace the entire type
571+ // if the type doesn't we just replace the underlying type of the pointer.
572+ // - 2024-03-26 Noggin_bops
573+ if ( return_override . Value . Contains ( "*" ) )
574+ d . ReturnType . Pointer = 0 ;
564575 d . ReturnType . CurrentType = return_override . Value ;
576+
577+ // If we replaced something with String we want to remove the pointer from the return type.
578+ // - 2024-03-24 Noggin_bops
579+ if ( return_override . Value == "String" )
580+ {
581+ d . ReturnType . Pointer -- ;
582+ }
565583 }
566584 }
567585 }
0 commit comments