ctaggart / froto

Froto: F# Protocol Buffers
MIT License
146 stars 27 forks source link

Compiler generates incorrect types for 'repeat' #58

Closed ghost closed 5 years ago

ghost commented 8 years ago

With the following .proto:

message a { repeated string test = 1; }

Froto.Roslyn.ProtoGen.generate returns the following:

using ProtoBuf;
using System.IO;

namespace ab
{
    [ProtoContract]
    public sealed class a
    {
        public string test { get; set; }
    }
}

namespace ab
{
    using ab;

    public static class ba
    {
        public static a Createa()
        {
            return new a();
        }

        public static void Serializea(Stream stream, a instance)
        {
            Serializer.Serialize(stream, instance);
        }

        public static a Deserializea(Stream stream)
        {
            return Serializer.Deserialize<a>(stream);
        }
    }
}

It would be expected that the type of test is that of some sort of enumerable (perhaps array).