[
https://issues.apache.org/jira/browse/THRIFT-1786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roger Meier reopened THRIFT-1786:
---------------------------------
hmm, what about mono?
{noformat}
Making check in csharp
make[2]: Entering directory `/home/roger/software/thrift/thrift-git/lib/csharp'
gmcs src/Collections/THashSet.cs src/Properties/AssemblyInfo.cs
src/Protocol/TBase.cs src/Protocol/TBase64Utils.cs
src/Protocol/TJSONProtocol.cs src/Protocol/TProtocolException.cs
src/Protocol/TProtocolFactory.cs src/Protocol/TList.cs src/Protocol/TSet.cs
src/Protocol/TMap.cs src/Protocol/TProtocolUtil.cs src/Protocol/TMessageType.cs
src/Protocol/TProtocol.cs src/Protocol/TType.cs src/Protocol/TField.cs
src/Protocol/TMessage.cs src/Protocol/TStruct.cs
src/Protocol/TBinaryProtocol.cs src/Protocol/TCompactProtocol.cs
src/Server/TThreadedServer.cs src/Server/TThreadPoolServer.cs
src/Server/TSimpleServer.cs src/Server/TServer.cs
src/Transport/TBufferedTransport.cs src/Transport/TTransport.cs
src/Transport/TSocket.cs src/Transport/TTransportException.cs
src/Transport/TStreamTransport.cs src/Transport/TFramedTransport.cs
src/Transport/TServerTransport.cs src/Transport/TServerSocket.cs
src/Transport/TTransportFactory.cs src/Transport/THttpClient.cs
src/Transport/THttpHandler.cs src/TProcessor.cs src/TApplicationException.cs
/out:Thrift.dll /target:library /reference:System.Web
src/Protocol/TBase.cs(22,34): error CS0246: The type or namespace name
`TAbstractBase' could not be found. Are you missing a using directive or an
assembly reference?
Compilation failed: 1 error(s), 0 warnings
make[2]: *** [Thrift.dll] Error 1
{noformat}
any idea?
> C# Union Typing
> ---------------
>
> Key: THRIFT-1786
> URL: https://issues.apache.org/jira/browse/THRIFT-1786
> Project: Thrift
> Issue Type: New Feature
> Components: C# - Compiler
> Reporter: Carl Yeksigian
> Assignee: Carl Yeksigian
> Fix For: 1.0
>
> Attachments: 1786.patch, 1786-v2.patch
>
>
> Given the thrift IDL:
> {code}
> struct A {
> 0: i32 value
> }
> union AUnion {
> 0: A field1,
> 1: A field2,
> 2: i32 value
> }
> {code}
> We should generate a C# subclassing tree:
> {code}
> class A : TBase {
> int Value { get;set; }
> }
> abstract class AUnion : TBase {
> abstract object Data { get; }
> protected int field;
> abstract void WriteUnionField(TProtocol tprot);
> class field1 : AUnion {
> A _data;
> override object Data { get { return _data; } }
> public field1(A data) {
> this._data = data;
> this.field = 0;
> }
> }
> class field2 : AUnion {
> A _data;
> override object Data { get { return _data; } }
> public field2(A data) {
> this._data = data;
> this.field = 1;
> }
> }
> class value : AUnion {
> int _data;
> override object Data { get { return _data; } }
> public value(int data) {
> this._data = data;
> this.field = 2;
> }
> }
> }
> {code}
> This gives us creation syntax of:
> {code}
> var aunion = new AUnion.value(10);
> {code}
> This should be an optional parameter to the compiler since it is a breaking
> change to existing code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira