T O P I C R E V I E W |
avt |
Posted - Dec 14 2017 : 04:50:57 AM I like to prototype code by having empty classes and inventing needed methods along the way, e.g.
auto result = class1_instance.method1(1.0, class2_instance.method2(1.0), 1.0);
In this case, method1 is already declared as
TypeA method1(double, TypeB, double);
Yet, when I use "Create from usage" on method2 (create declaration is unavailable), VAX will suggest a method that accepts two parameters (double and unknown instead of only double) and returns TypeA (instead of TypeB).
I was unsure if I should file this as a bug or improvement on existing feature.
Thanks. |
6 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Dec 20 2017 : 06:49:33 AM I have just loaded the forum in a new browser window, where I am not logged in, and I have no ability to post anything. I don't recall ever seeing the forum let me post when I am not logged in, but to be fair I am logged in most of the time.
We know the forum is fairly old now, but it does its job, so diverting limited resources to move to a newer forum system, and moving all of the historical information across with it, isn't really a priority for us. Sorry about this, but email is also available for support queries if that is easier for you. |
avt |
Posted - Dec 20 2017 : 04:36:36 AM Forum responses are great!
About the forum, I'm sorry, but I would say that 99.9% of forums out there handle this particular thing better nowadays. Just separating log in and post writing would help this particular issue immensely, and saving the content of a form entry field when something fails is basic internet form 101 for at least the last 5-10 years. |
feline |
Posted - Dec 19 2017 : 06:31:41 AM We do try to respond quickly to all questions and bug reports, either via the forum or email
As for the forum, sadly, this is a known problem with everything online. Unless what you are doing is being saved for you as you go along, it is always at risk if something times our or goes wrong. I tend to copy everything to the clipboard before sending it, just because I have been caught one to many times over the years. |
avt |
Posted - Dec 19 2017 : 05:01:22 AM Hi,
Thanks for your response! I actually meant class1_instance and class2_instance but your test case likely covers the problem since the return types differ in the same way. That said, if you can't reproduce the behavior I described, that might be it.
It's nice to see responses and actions initiated directly here on the forums. Knowing this I will be sure to report any other issues I find. The only other thing to complain about at the moment is your forum, which threw away the previous incarnation of this post I just wrote because I misspelled the password...
Cheers and Happy Holidays! |
feline |
Posted - Dec 16 2017 : 08:52:20 AM I have opened a bug report for the problems I am seeing here with Create From Usage, when the new function being created is seen as a parameter of a known function:
case=113221
If you have something else going on that also breaks, can you please post an example I can study? |
feline |
Posted - Dec 15 2017 : 07:19:54 AM First the easy bit, in this situation Create Declaration isn't going to be offered, since you are not triggering it on an implementation. Perhaps this is a bit narrow, but it does give us a focused and well defined refactoring command.
I have expanded on your line of code, to make a more useful test case, but in doing so, in your code sample do you really mean to use "class2instance" in the parameter call? Or should this be class1_instance? It changes what is going on here.
Assuming you mean "class1_instance" in both cases, I have created the following test case. This code in the header file:
enum felinePrototypeEnumReturn { RETURN_ONE, RETURN_TWO };
enum felinePrototypeEnumParam { PARAM_ONE, PARAM_TWO };
class felineTestPrototypeClass
{
felinePrototypeEnumReturn simpleMethodEnumInEnumOut(double, felinePrototypeEnumParam, double);
}; and this code in the matching cpp file:
felinePrototypeEnumReturn felineTestPrototypeClass::simpleMethodEnumInEnumOut(double valueOne, felinePrototypeEnumParam enumTwo, double valueThree)
{
return felinePrototypeEnumReturn::RETURN_ONE;
}
void usingFelinePrototypeClass()
{
felineTestPrototypeClass protoClassFoo;
auto result = protoClassFoo.simpleMethodEnumInEnumOut(1.0, protoClassFoo.newMethodNotCreatedYet(1.0), 1.0);
} which is causing a problem with Create From Usage, so I want to run some tests, to try and get a good feel of what works and what fails here with Create From Usage on new function calls.
But am I testing what you are doing here? Or am I testing a different situation? |
|
|