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.

SyntaxError when prefixing delegation to instance variable

#1235

When using :prefix => true in a delegation to an instance or class variable, a SyntaxError is raised:

compile error\n(__DELEGATION__):1: syntax error, unexpected '(', expecting tCOLON2 or '.'

This patch checks the :to value if :prefix => true is set, raising an ArgumentError if it matches ^[^a-z_], that is, if it doesn't look like a method name.

Reported by Daniel Schierbeck · October 19th, 2008 @ 07:51 PM

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

Activity

  1. Daniel Schierbeck
    Daniel Schierbeck

    Bump.

    This is a crasher -- would anyone care to take a look at it? It's a rather trivial patch, and comes with a test 'n all.

    November 20th, 2008 @ 07:31 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [2f7c073f1981ee2e901e33606c8f864fbb10dc4c]) Ensure only delegations to methods can have an automatic prefix. [#1235 SyntaxError when prefixing delegation to instance variable state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    November 20th, 2008 @ 07:52 PM

  3. Repository
    Repository

    (from [a5156d9c2c3fe63f8b6a352199e51544ae28876a]) Ensure only delegations to methods can have an automatic prefix. [#1235 SyntaxError when prefixing delegation to instance variable state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    November 20th, 2008 @ 07:52 PM