mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 23:01:44 +01:00
The TypeDefinition is no longer overloaded for Annotation and Constant nodes, and the generator is happy again.
19 lines
537 B
C#
19 lines
537 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace CapnpC.Model
|
|
{
|
|
interface IHasNestedDefinitions
|
|
{
|
|
IEnumerable<TypeDefinition> NestedTypes { get; }
|
|
ICollection<IDefinition> NestedDefinitions { get; }
|
|
ICollection<Constant> Constants { get; }
|
|
}
|
|
|
|
static partial class Extensions
|
|
{
|
|
public static IEnumerable<TypeDefinition> GetNestedTypes(this IHasNestedDefinitions def)
|
|
=> def.NestedDefinitions.Select(d => d as TypeDefinition).Where(d => d != null);
|
|
}
|
|
}
|