boo-lang / boo

The Boo Programming Language.
BSD 3-Clause "New" or "Revised" License
874 stars 148 forks source link

Bad error message when passing a property to a ref parameter #154

Open masonwheeler opened 8 years ago

masonwheeler commented 8 years ago
class MyClass:
    [Property(Data)]
    _data as int

    def Test():
        Increment(Data)

def Increment(ref value as int):
    ++value

At first glance, it looks like this should either work, or fail with an error saying you can't pass a property to a ref parameter. But instead, it does neither, preferring to give a much less useful error:

The best overload for the method 'MyClassModule.Increment(int)' is not compatible with the argument list '(int)'. (BCE0017)

This should be fixed, either with a new error message or by adding something behind the scenes to automagically get the property value as a local, pass it, and then set the result.

@bamboo Any thoughts as to which behavior would be preferable?