You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Evan Weaver (JIRA)" <ji...@apache.org> on 2009/08/09 18:14:14 UTC
[jira] Created: (THRIFT-556) Ruby compiler does not correctly
referred to top-level modules when a submodule masks the top-level name
Ruby compiler does not correctly referred to top-level modules when a submodule masks the top-level name
--------------------------------------------------------------------------------------------------------
Key: THRIFT-556
URL: https://issues.apache.org/jira/browse/THRIFT-556
Project: Thrift
Issue Type: Bug
Components: Compiler (Ruby)
Reporter: Evan Weaver
Currently, if you set a top-level module for thrift/ruby that's the same name as an inner class, thrift does not reference the top level appropriately. Example bad code:
.thrift:
namespace rb Cassandra
.rb:
module Cassandra
module Cassandra
class Client
...
COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => Cassandra::ColumnParent},
Ruby checks the inner module first, and does not find the class, raising an error.
The fix is to have every place that references the top-level module prepend it with '::':
COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => ::Cassandra::ColumnParent},
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-556) Ruby compiler does not correctly
referred to top-level modules when a submodule masks the top-level name
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742469#action_12742469 ]
Bryan Duxbury commented on THRIFT-556:
--------------------------------------
Is this in trunk, or in the old release? I swear we had fixed this issue at some point in the past.
> Ruby compiler does not correctly referred to top-level modules when a submodule masks the top-level name
> --------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-556
> URL: https://issues.apache.org/jira/browse/THRIFT-556
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (Ruby)
> Reporter: Evan Weaver
>
> Currently, if you set a top-level module for thrift/ruby that's the same name as an inner class, thrift does not reference the top level appropriately. Example bad code:
> .thrift:
> namespace rb Cassandra
> .rb:
> module Cassandra
> module Cassandra
> class Client
> ...
> COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => Cassandra::ColumnParent},
> Ruby checks the inner module first, and does not find the class, raising an error.
> The fix is to have every place that references the top-level module prepend it with '::':
> COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => ::Cassandra::ColumnParent},
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.