Actions
Feature #16644
closedqualified const init (self::CONST1 = 1) should be allowed in methods
Feature #16644:
qualified const init (self::CONST1 = 1) should be allowed in methods
Status:
Rejected
Assignee:
-
Target version:
-
Description
module Mod1
def self.define_consts
const_set(:CONST1, :CONST1)
# this is actual const re-assignment but only a warning
const_set(:CONST1, :CONST1)
# this is const initialization but becomes an error
# because it looks like it could be re-assignment
# if actual const re-assignment is only a warning
# why is a possible const re-assignment (which might not be one), an error
self::CONST2 = :CONST2 unless const_defined?(:CONST2, false)
end
define_consts
end
Actions