Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

memoize_all fails when method has ? or ! at the end and arity > 0

#1175

Steps to reproduce:

1) define a class


      klass = Class.new
      klass.class_eval do
        extend ActiveSupport::Memoizable
        def can_memoize_question?(args)
          args
        end
        memoize :can_memoize_question?

        def memoize_bang!(args)
          args
        end
        memoize :memoize_bang!
      end

2) memoize_all


klass.new.memoize_all

3) delight the error


NameError: `@_memoized_memoize_bang!' is not allowed as an instance variable name

Reported by Eugene Pimenov · October 5th, 2008 @ 01:02 AM

State: resolved
Milestone: 2.x
Assigned to: josh josh
Importance: none

Activity

  1. josh
    josh
    • Assigned user set to josh
    • State changed from new to open

    October 5th, 2008 @ 03:08 PM

  2. Repository
    Repository
    • State changed from open to resolved

    (from [8603813ac6e1bff8d3addad58d0a56b33baafc59]) Fix memoize_all for methods with punctuation [#1175 memoize_all fails when method has ? or ! at the end and arity > 0 state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    October 5th, 2008 @ 11:26 PM