Project

General

Profile

Feature #10406

Method starting with a capital is not detected when parentheses and receiver are omitted

Added by sawa (Tsuyoshi Sawada) about 6 years ago. Updated about 6 years ago.

Status:
Rejected
Priority:
Normal
Target version:
[ruby-core:65810]

Description

A method whose name starts with a capital is not detected when parentheses and receiver are omitted.

def Foo; puts "foo" end
Foo # => uninitialized constant Foo

If I disambiguate it as a method, then the method is detected:

Foo() # => foo

This kind of consideration if unnecessary if the method name does not start with a capital.

def foo; puts "foo" end
foo # => foo

So I expect method Foo to be detected without explicit receiver and arguments (unless there is a constant with the same name).

def Foo; puts "foo" end

I first thought this as a bug. If it is not a bug, then I would like to ask this as a feature request.

Also available in: Atom PDF