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

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

Comments

Projects
None yet
3 participants
@codeconsole
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@glaforge

glaforge Nov 19, 2011

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@codeconsole

codeconsole Nov 20, 2011

Contributor

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++.
Contributor

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