GithubHelp home page GithubHelp logo

Comments (5)

c-blake avatar c-blake commented on June 25, 2024

First, I agree it's not a great error message for a common situation. However, the error message in question is not from me, but from Nim. It has recently changed to Error: node lacks field: symbol. It's also compile time messaging/erroring out not some run time exception I could catch. So, I'm not sure I have any control at all over what it says.

from cligen.

alaviss avatar alaviss commented on June 25, 2024

You can check the node type beforehand. If it's nnk{Closed,Open}SymChoice (it was nnkClosedSymChoice in this case), then you can just print out every overload found with a nice error message.

A lazy approach is to use typed{nkSym} as the parameter to offload the job to the compiler. The error message would not be nice, but it's understandable.

from cligen.

c-blake avatar c-blake commented on June 25, 2024

Ah. Good suggestions. Do you know a way at the macro call site to refer (more verbosely, obviously) to a specific get overload? If so, I could also put that in the error message as guidance.

from cligen.

c-blake avatar c-blake commented on June 25, 2024

(I mean, of course, the type signature not just the module qualifier...)

from cligen.

c-blake avatar c-blake commented on June 25, 2024

I went with the lazier typed{nkSym} approach. I agree it's an ugly error message, but I feel it's a better overall solution for you to submit an issue to Nim to get them to format it more nicely for everyone. See test/QualifiedSym.nim.

from cligen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.