After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698336 - array .length is not correct in ensures clause
array .length is not correct in ensures clause
Status: RESOLVED DUPLICATE of bug 737222
Product: vala
Classification: Core
Component: Arrays
0.20.x
Other All
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-18 23:59 UTC by Adam Stark
Modified: 2016-01-30 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Output c code. (473 bytes, application/octet-stream)
2013-04-18 23:59 UTC, Adam Stark
Details
vala source (80 bytes, application/octet-stream)
2013-04-19 00:00 UTC, Adam Stark
Details

Description Adam Stark 2013-04-18 23:59:32 UTC
Created attachment 241865 [details]
Output c code.

when doing an "ensures" check, the length of an array is set to -1, even when it is known.

For instance the attached test.vala produces the attached test.c file. 

Line 20 in the output c could be better written "_tmp2__length1 = _tmp1__length1;".

Incidentally, it would be more readable if it used a vala-specific warning macro, similar to vala-assert that doesn't obfuscate the original code.
Comment 1 Adam Stark 2013-04-19 00:00:35 UTC
Created attachment 241866 [details]
vala source
Comment 2 Ben 2016-01-29 22:38:52 UTC
This appears to have been fixed
Comment 3 Jürg Billeter 2016-01-30 17:43:39 UTC
Thanks for taking the time to report this.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed in the code repository.

*** This bug has been marked as a duplicate of bug 737222 ***