File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/Generator/Generators/C Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,10 @@ public override bool VisitProperty(Property property)
226226 if ( property . HasGetter )
227227 GeneratePropertyGetter ( property . GetMethod ) ;
228228
229- if ( property . HasSetter )
229+ if ( property . HasSetter && property . SetMethod != null )
230230 GeneratePropertySetter ( property . SetMethod ) ;
231231
232- PopBlock ( ) ;
232+ PopBlock ( NewLineKind . Never ) ;
233233
234234 return true ;
235235 }
@@ -447,11 +447,18 @@ public void GenerateFunctionCall(Function function)
447447 var method = function as Method ;
448448 var @class = function . Namespace as Class ;
449449
450- var field = ( method ? . AssociatedDeclaration as Property ) ? . Field ;
450+ var property = method ? . AssociatedDeclaration as Property ;
451+ var field = property ? . Field ;
451452 if ( field != null )
452453 {
453454 Write ( $ "((::{ @class . QualifiedOriginalName } *){ Helpers . InstanceIdentifier } )->") ;
454- WriteLine ( $ "{ field . OriginalName } ;") ;
455+ Write ( $ "{ field . OriginalName } ") ;
456+
457+ var isGetter = property . GetMethod == method ;
458+ if ( isGetter )
459+ WriteLine ( ";" ) ;
460+ else
461+ WriteLine ( $ " = { @params [ 0 ] . Name } ;") ;
455462 }
456463 else
457464 {
You can’t perform that action at this time.
0 commit comments