Skip to content

How to join arrays without losing type information? #120

@jons-bakerhill

Description

@jons-bakerhill

I have the following template code

{{- publicProperties = class.Properties | Custom.HasPublicSetter
    if (class.BaseClass?.Properties)
        publicProperties = Array.AddRange(publicProperties, class.BaseClass?.Properties | Custom.HasPublicSetter)
    end
    referencedClassTypes = publicProperties | Custom.GetClassTypes
}}

where GetClassTypes is defined as
public static IEnumerable<IType> GetClassTypes(IEnumerable<IProperty> publicProperties)

When rendering I get the error "Unable to convert type range to IEnumerable<IProperty>"

Is there a way to join arrays and keep type information?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions