Skip to content

Instantly share code, notes, and snippets.

@godfat
Created December 1, 2008 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godfat/30606 to your computer and use it in GitHub Desktop.
Save godfat/30606 to your computer and use it in GitHub Desktop.
Kernel and IncludedModule
# http://rubinius.lighthouseapp.com/projects/5089/tickets/729-kernel-and-includedmodule
module M
def m
end
end
module K
end
class C
include K
end
module K
include M
end
C.new.m # => undefined method
class D
include K
end
D.new.m # => nil
C.new.m # => undefined method
module M
def m
end
end
module Kernel
include M
end
class C
end
C.new.m # => undefined method
class D
include Kernel
end
D.new.m # => nil
C.new.m # => nil in Rubinius
# undefined method in MRI 1.8/1.9 and JRuby
module K
end
class O
include K
end
class C < O
end
class D < O
end
module M
def m
end
end
module K
include M
end
C.new.m # => undefined method
D.new.m # => undefined method
class D
include K
end
D.new.m # => nil
C.new.m # => nil in Rubinius
# undefined method in MRI 1.8/1.9 and JRuby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment