-
Notifications
You must be signed in to change notification settings - Fork 40
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
Using a property ::= does not work for rvalue covers because a pointer is expected #940
Comments
I'm taking a look at this right now (I'm assuming myCovers is an ArrayList of some cover) but what was said in the ooc-kean issue looks accurate. |
It looks like we could generate some code that would handle it, I will reopen the issue if we indeed can. |
Let me take a closer look and get back to you on this. |
I can reproduce this with an ooc array: import structs/ArrayList
Foo: cover {
calculated ::= 42
}
arr := Foo[1] new()
foo: Foo
arr[0] = foo
arr[0] calculated toString() println() Using an ArrayList seems to work on my end. If you could post a testcase I would be grateful. |
@marcusnaslund , just a reminder... |
import structs/ArrayList
Foos: class {
init: func
operator [] (index: Int) -> Foo {
Foo new()
}
}
Foo: cover {
bar: Int
init: func@
}
foos := Foos new()
list := ArrayList<Int> new()
list add(foos[0] bar) This fails to build with the error
However, any of the 3 following changes will independently fix the build error:
foo := foos[0]
list add(foo bar)
bar: Int { get set }
Foo: class {
bar: Int
init: func
} I don't know if this is specifically what @marcusnaslund had a problem with, but perhaps it's related? |
Oh, thank you very much @davidhesselbom - then we are able to reproduce this issue both with arrays and |
For example:
It appears properties have similar limitations in C# as well, so I don't know what the plan is here.
At least, the error should be explained by rock instead of failing in the C compiler.
The text was updated successfully, but these errors were encountered: