Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non working property syntax #812

Closed
simonmika opened this issue Sep 1, 2014 · 2 comments

Comments

@simonmika
Copy link

commented Sep 1, 2014

The following syntax for properties (as described here):

Tree: class {
  age: Int {}
  test: func -> Int {
    age
  }
}

Results in the following error message for the body of the test method:

error No such function __getage__() for `Tree`
        age
        ~~~

But the following works:

Tree: class {
  age: Int { get set }
  test: func -> Int {
    age
  }
}

Is it an deprecated syntax (it is not described on the ooc webpage) or is something else wrong?

@alexnask

This comment has been minimized.

Copy link
Collaborator

commented Sep 9, 2014

This may be a bug indeed, I don't remember seeing any code using the {} syntax though.
@fasterthanlime, do we want this or not?

@fasterthanlime

This comment has been minimized.

Copy link
Collaborator

commented Sep 9, 2014

Better fix the doc, { get set } is the standard way for now.

On Tue, Sep 9, 2014 at 5:50 PM, Alexandros Naskos notifications@github.com
wrote:

This may be a bug indeed, I don't remember seeing any code using the {}
syntax though.

@fasterthanlime https://github.com/fasterthanlime, do we want this or
not?


Reply to this email directly or view it on GitHub
#812 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.