Non working property syntax #812

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

Projects

None yet

3 participants

@simonmika

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?

@shamanas
Collaborator
shamanas 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
Collaborator

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).

@shamanas shamanas closed this Sep 19, 2014
@fasterthanlime fasterthanlime modified the milestone: 0.9.10 Jul 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment