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

unindexed should be graceful e.g. allow access to indexed properties #90

Closed
codeconsole opened this issue Nov 18, 2011 · 2 comments
Closed

Comments

@codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Nov 18, 2011

e.g.

class Person {
    String name
    @Unindexed int age
}

def p = new Person(name: 'Bob', age: 22)
p.age++ // ok
def e = p as Entity
assert e.isUnindexedProperty('age') == true 
e.age++ // This works, it makes an unindexed property indexed
assert e.isUnindexedProperty('age') == false     
e.unindexed.age++ // This FAILS, but it SHOULD make an indexed property unindexed
assert e.isUnindexedProperty('age') == true  // This should be true if the previous line did not throw an exception  
@glaforge
Copy link
Contributor

@glaforge glaforge commented Nov 19, 2011

Should e.age++ really make the property indexed in the first place?
And you'd want that simply by accessing e.unindexed.age (without assigning any value to it), it should be made unindexed?

I'm really not sure what should be the correct behavior (if any).

@codeconsole
Copy link
Contributor Author

@codeconsole codeconsole commented Nov 20, 2011

Should e.age++ really make the property indexed in the first place?

  • Probably not, but it does. So that is why I am recommending this to make everything consistent.

And you'd want that simply by accessing e.unindexed.age (without assigning any value to it), it should be made unindexed?

  • That was a typo, I fixed it. I meant e.unindexed.age++.
@musketyr musketyr closed this in 30989cf Feb 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.