|
Bugzilla – Full Text Bug Listing |
| Summary: | YCP (yast2-core) - Reference to Integer doesn't work | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 10.3 | Reporter: | Lukas Ocilka <locilka> |
| Component: | YaST2 | Assignee: | Martin Vidner <mvidner> |
| Status: | RESOLVED WONTFIX | QA Contact: | Jiri Srain <jsrain> |
| Severity: | Normal | ||
| Priority: | P3 - Medium | CC: | aschnell, kkaempf |
| Version: | Alpha 1 | ||
| Target Milestone: | unspecified | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
Apparently there is a bug in Type::basematch:
if (expected->isReference()
&& (!expected->isConst()
&& isConst()))
{
#if DO_DEBUG
y2debug ("doesn't expect const");
#endif
return -1;
}
I don't know what this means, it may intend to prevent initializing a reference to a const to something that is not a const, but it swaps "this" and "expected".
It happens to work for strings, because string literals are of type string, not const string. Weird.
I will not fix this bug for 10.2. Moving to 10.3 *** Bug 408891 has been marked as a duplicate of this bug. *** float fails as well. The reason is that integer and float constants are 'const' while string, map and list are not. wontfix |
See this example: { void ChangeInteger (integer & in) { y2milestone("Changing from %1", in); in = 2; } integer in1 = 1; y2milestone("Old Integer: %1", in1); ChangeInteger(in1); y2milestone("New Integer: %1", in1); } It should work but ycpc reports: parsing 'ref_int.ycp' ref_int.ycp:4 [Parser] type mismatch in assignment ref_int.ycp:4 [Parser] Expected 'integer &', seen 'const integer'. Error This works for 'map' and 'string' (both tested), I hope it works for the other types as well.