Skip to content

Bug on multiple inclusion for classes #814

@BuonOmo

Description

@BuonOmo

I'm trying to fix completion (in irb) for https://github.com/rgeo/rgeo. However, I stumbled upon an issue which once reduced to a minimal example seems to be a Rdoc bug:

# t.rb
module RGeo
  module Feature
    module Surface
      # YEAH YEAH YIPIYEAH YIPIYO
      def centroid
        puts "I can be executed"
      end
    end
  end
end

module RGeo
  module Feature
    module Polygon
      include Surface
    end
  end
end

module RGeo
  class Geos
    class CAPIPolygonImpl # changing that for `module Geos` works
      include Feature::Polygon
    end
  end
end
$ rdoc -q -f ri --op t t.rb
$ ri --no-standard-docs -d t RGeo::Geos::CAPIPolygonImpl#centroid
Nothing known about RGeo::Geos::CAPIPolygonImpl#centroid

The code is valid ruby (you never now ^^, ruby -r./t.rb -e 'RGeo::Geos::CAPIPolygonImpl.new.centroid'). And changing the class CAPIPolygonImpl to module CAPIPolygonImpl gives the expected output:

$ ri --no-pager --no-standard-docs -d t RGeo::Geos::CAPIPolygonImpl#centroid
RGeo::Geos::CAPIPolygonImpl#centroid

(from /Users/ulysse/Dev/rgeo/rgeo/t)
Implementation from Surface
------------------------------------------------------------------------
  centroid()

------------------------------------------------------------------------

YEAH YEAH YIPIYEAH YIPIYO

Do you have any hint on where it could come from?

Thank you 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions