-
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
Fields initialized as array literals in a class' defaults generate invalid C code #912
Comments
Hmm did I upload a bad 0.9.11-prealpha1 bootstrap? Will have to check.
The wrong order for literals is something I've seen in the middle of my cleanups, but I think it was before the 0.9.10 release. Might have been after and I'm mistaken, though. |
By manually switching around the C code and using the instructions from here, I managed to get c_rock, I do get 'C compiler failed on module os/native/TerminalWin32 from sdk, bailing out' on make self though, so I assume the C code generated is still invalid, will tkae a look now. (By the way, c_rock -V output is |
Ah yes, actually the release was made here: 3f04249 Looking at the history for ArrayLiteral, it looks like it hasn't been touched after July 10? Would that mean that it is still broken? Actually, that's completely plausible, since the travis tests don't run on Windows, the windows code doesn't even compile. |
A simple test: Foo: class{
test := [1, 2, 3]
init: func
}
describe("array literial should be correctly unwrapped in default",|| Foo new()) |
@zhaihj if at all possible, I prefer tests to do some runtime checking as well. That test might very well compile but put garbage inside the array, and we wouldn't know (and it's happened before..) |
As a temporary workaround, I applied @zhaihj's patch and commented out the failing code in TerminalWin32.ooc, then made rock with c_rock ( And then, of course, uncommented the code and ran a regular |
Closed by #915! |
Here are the problematic C sources (come from sdk/os/native/TerminalWin32.ooc):
The following code is produced by the following ooc code:
I'm also getting the "undefined reference to `GC_beginthreadex'" error when I correct the C code manually, I've gotten around that one before though, I'll figure it out.
Any idea why the array literal is defined after the actual variable?
Perhaps some issue with array members in version blocks?
I can't really find another testcase atm, I will come up with one if I manage to get rock to compile though.
The text was updated successfully, but these errors were encountered: