@@ -743,19 +743,15 @@ protected MethodDeclarationSyntax CreateParentedNodeMethod()
743743 protected PropertyDeclarationSyntax [ ] CreateChildrenProperties ( )
744744 {
745745 return new PropertyDeclarationSyntax [ ] {
746- // IEnumerable<IRecursiveType> IRecursiveParent.Children { get; }
746+ // IEnumerable<IRecursiveType> IRecursiveParent.Children => this.greenNode.Children;
747747 SyntaxFactory . PropertyDeclaration ( Syntax . IEnumerableOf ( Syntax . GetTypeSyntax ( typeof ( IRecursiveType ) ) ) , nameof ( IRecursiveParent . Children ) )
748748 . WithExplicitInterfaceSpecifier ( SyntaxFactory . ExplicitInterfaceSpecifier ( Syntax . GetTypeSyntax ( typeof ( IRecursiveParent ) ) ) )
749- . AddAccessorListAccessors ( SyntaxFactory . AccessorDeclaration (
750- SyntaxKind . GetAccessorDeclaration ,
751- SyntaxFactory . Block (
752- // return System.Linq.Enumerable.Cast<IRecursiveType>(this.Children);
753- SyntaxFactory . ReturnStatement (
754- Syntax . EnumerableExtension (
755- SyntaxFactory . GenericName ( nameof ( Enumerable . Cast ) )
756- . AddTypeArgumentListArguments ( Syntax . GetTypeSyntax ( typeof ( IRecursiveType ) ) ) ,
757- Syntax . ThisDot ( this . applyTo . RecursiveParent . RecursiveField . NameAsProperty ) ,
758- SyntaxFactory . ArgumentList ( ) ) ) ) ) ) ,
749+ . WithExpressionBody ( SyntaxFactory . ArrowExpressionClause (
750+ SyntaxFactory . MemberAccessExpression (
751+ SyntaxKind . SimpleMemberAccessExpression ,
752+ Syntax . ThisDot ( GreenNodeFieldName ) ,
753+ this . applyTo . RecursiveParent . RecursiveField . NameAsProperty ) ) )
754+ . WithSemicolonToken ( SyntaxFactory . Token ( SyntaxKind . SemicolonToken ) ) ,
759755 // IEnumerable<TRootedRecursiveType> IRecursiveParent<TRootedRecursiveType>.Children { get; }
760756 SyntaxFactory . PropertyDeclaration ( Syntax . IEnumerableOf ( this . rootedRecursiveType ) , nameof ( IRecursiveParent < IRecursiveType > . Children ) )
761757 . WithExplicitInterfaceSpecifier ( SyntaxFactory . ExplicitInterfaceSpecifier ( CreateIRecursiveParentOfTSyntax ( this . rootedRecursiveType ) ) )
0 commit comments