You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Carl Yeksigian (JIRA)" <ji...@apache.org> on 2012/12/22 00:33:14 UTC

[jira] [Commented] (THRIFT-1212) Members capital case conflict

    [ https://issues.apache.org/jira/browse/THRIFT-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538536#comment-13538536 ] 

Carl Yeksigian commented on THRIFT-1212:
----------------------------------------

I think it makes sense to disallow the name of a member from being the same as the name of the class (in any capitalization, which is why this is breaking for C#). I feel like that would force better naming for structs, or the use of a typedef instead.
                
> Members capital case conflict
> -----------------------------
>
>                 Key: THRIFT-1212
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1212
>             Project: Thrift
>          Issue Type: Bug
>          Components: C# - Compiler
>    Affects Versions: 0.6.1
>         Environment: Windows 7
>            Reporter: Vadim Chekan
>            Priority: Minor
>
> When generating "csharp" target off the following structure:
> ===
> struct Order {
>   1: string col,  // sort column name
>   2: i32    order // asc(1) or desc(0)
> }
> ===
> the code is generated:
> class Order { public int Order ...
> This code fails to compile in C# compiler because member name is the same as containing clsss  name, which is invalid in C#.
> Perhaps there must be a check when generating members and if capitalized member name turns out to be the same as containing class name, then prepend it with underscore.

--
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