abo-abo / function-args

C++ completion for GNU Emacs
120 stars 10 forks source link

cl-delete: Wrong type argument: listp, "_Answer" #7

Closed tuhdo closed 10 years ago

tuhdo commented 10 years ago

I got this error when trying to moo-complete a string. Here is the code:

coloring_solver.cpp: http://pastebin.com/5fVdN7yx coloring_solver.h: http://pastebin.com/f4hGmnXW vertex.h: http://pastebin.com/Gwg77QXS

You can moo-complete it in the cpp file.

tuhdo commented 10 years ago

moo-complete works fine on this simple file:

http://pastebin.com/vaWZBMiD

tuhdo commented 10 years ago

I know the reason. I got another variable with the name "a", and I assign the same name to the string variable. Maybe in this case, a more useful message should be displayed.

abo-abo commented 10 years ago

This issue will not occur if you use this idiomatic C++ code:

struct Answer
{
    unsigned obj = 0;
    unsigned opt = 0;
    std::string answer;
};

instead of your old-style C code. It's related to typedefs not being de-referenced currently by function-args, like in the issue #6. I'll try to fix it soon.

abo-abo commented 10 years ago

Try it out now. It should work with your old code as well.