Skip to content

Enum array support for Swift generator #108

@nil4

Description

@nil4

Generated Swift code does not build when a C# method has an argument of type enum array.

To reproduce, add a new method to the managed sample EnumTests class:

public void EnumArray(TestEnum[] values) { }

After publishing the managed sample project, running the generator runs into an error similar to:

BeyondNETBuilderSwiftBuilder_BeyondDotNETSampleKit_8PkT7x/Generated_Swift.swift:154522:40: error: 'DNArray' requires that 'Beyond_NET_Sample_Source_TestEnum' inherit from 'System_Object'
   249 | /// This is a generic base class for all single-dimensional .NET array types with non-null element types.
   250 | /// The element type of the array is specified as the first and only generic type argument.
   251 | public class DNArray<T: System_Object>: System_Array, MutableCollection {
       |              `- note: requirement specified as 'T' : 'System_Object' [with T = Beyond_NET_Sample_Source_TestEnum]
   252 |     public typealias Element = T
   253 |     public typealias Index = Int32
       :
154520 |        }
154521 |        
154522 |        public func enumArray(_ values: DNArray<Beyond_NET_Sample_Source_TestEnum> /* Beyond.NET.Sample.Source.TestEnum[] */) throws {
       |                                        `- error: 'DNArray' requires that 'Beyond_NET_Sample_Source_TestEnum' inherit from 'System_Object'
154523 |                let valuesC = values.__handle

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions