[BUG?] Object property

Is this a bug?

def myProp= (var)
    @var = var
end

def myProp
    @var
end

myProp = "local"
myProp # => "local"
self.myProp # => nil

self.myProp = "works"
myProp # => "local"
self.myProp # => "works"

Whereas, I'd expect:
myProp = "hello"
myProp # => "hello"
self.myProp # => "hello"

Shouldn't the interpreter try to call the 'myProp' function before going
and creating a new 'myProp' local variable?

-Greg

CONFIDENTIALITY NOTICE

This message and any included attachments
are from Cerner Corporation and are intended
only for the addressee. The information
contained in this message is confidential and
may constitute inside or non-public information
under international, federal, or state
securities laws. Unauthorized forwarding,
printing, copying, distribution, or use of such
information is strictly prohibited and may be
unlawful. If you are not the addressee, please
promptly delete this message and notify the
sender of the delivery error by e-mail or you
may call Cerner's corporate offices in Kansas
City, Missouri, U.S.A at (+1) (816)221-1024.
---------------------------------------- --

Fitzgerald,Greg wrote:

Is this a bug?

No, it is not (see bellow).

def myProp= (var)
    @var = var
end

def myProp
    @var
end

myProp = "local"

This will always be interpreted as the variable assignment to avoid inconsistency. Just imagine the case when you have such a statement where you do mean assignment to a local variable 'myProp' (storing intermediate results of some computation) and later on you add a method myProp=(value).

Gennady.